diff --git a/generated/Reservations/Reservations.Autorest/Az.Reservations.csproj b/generated/Reservations/Reservations.Autorest/Az.Reservations.csproj index 9b8f0f42cb09..894e01e58f3d 100644 --- a/generated/Reservations/Reservations.Autorest/Az.Reservations.csproj +++ b/generated/Reservations/Reservations.Autorest/Az.Reservations.csproj @@ -2,9 +2,9 @@ Reservations Reservations + Reservations.Autorest - diff --git a/generated/Reservations/Reservations.Autorest/Az.Reservations.format.ps1xml b/generated/Reservations/Reservations.Autorest/Az.Reservations.format.ps1xml index 2dc4f5c61aba..55a1882e7a7d 100644 --- a/generated/Reservations/Reservations.Autorest/Az.Reservations.format.ps1xml +++ b/generated/Reservations/Reservations.Autorest/Az.Reservations.format.ps1xml @@ -2,132 +2,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsIdentity + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationList - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsIdentity - - - - - - - - - - - - - - - - - - ReservationId - - - ReservationOrderId - - - SubscriptionId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.ProxyResource - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.ProxyResource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt - - - SystemDataLastModifiedBy - - - SystemDataLastModifiedByType - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.Resource - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.Resource - - - - - - - - - - - - Name - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationList - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationList + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationList#Multiple - - - @@ -135,18 +18,15 @@ NextLink - - Value - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties#Multiple @@ -190,31 +70,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AvailableScopeRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeOperationResultResponse - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AvailableScopeRequestProperties - - - - - - - - - - - - Scope - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeOperationResultResponse - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeOperationResultResponse + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeOperationResultResponse#Multiple @@ -240,9 +98,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeResponseProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeResponseProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeResponseProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeResponseProperties#Multiple @@ -262,9 +120,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponseProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponseProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponseProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponseProperties#Multiple @@ -326,9 +184,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesBillingCurrencyTotal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesBillingCurrencyTotal - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesBillingCurrencyTotal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesBillingCurrencyTotal#Multiple @@ -354,9 +212,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesPricingCurrencyTotal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesPricingCurrencyTotal - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesPricingCurrencyTotal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesPricingCurrencyTotal#Multiple @@ -382,9 +240,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateRefundRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundRequestProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateRefundRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundRequestProperties#Multiple @@ -404,9 +262,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Catalog + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Catalog - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Catalog + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Catalog#Multiple @@ -444,31 +302,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogBillingPlans - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogBillingPlans - - - - - - - - - - - - Item - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogsResult + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogsResult - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogsResult + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogsResult#Multiple @@ -494,9 +330,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryRequest + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryRequest - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryRequest + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryRequest#Multiple @@ -516,9 +352,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResult + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResult - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResult + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResult#Multiple @@ -550,9 +386,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Commitment + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Commitment - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Commitment + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Commitment#Multiple @@ -584,9 +420,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ErrorDetails + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ErrorDetails - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ErrorDetails + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ErrorDetails#Multiple @@ -618,9 +454,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeOperationResultResponse + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeOperationResultResponse - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeOperationResultResponse + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeOperationResultResponse#Multiple @@ -646,9 +482,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyError + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyError - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyError + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyError#Multiple @@ -674,9 +510,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeRequestProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeRequestProperties#Multiple @@ -696,9 +532,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeResponseProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeResponseProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeResponseProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeResponseProperties#Multiple @@ -718,9 +554,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedErrorInfo + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedErrorInfo - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedErrorInfo + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedErrorInfo#Multiple @@ -746,9 +582,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfo + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfo - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfo + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfo#Multiple @@ -774,31 +610,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.MergeProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.MergeProperties - - - - - - - - - - - - Source - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationDisplay - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationDisplay#Multiple @@ -836,9 +650,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationList + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationList - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationList + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationList#Multiple @@ -858,9 +672,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResponse + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResponse - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResponse + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResponse#Multiple @@ -892,9 +706,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultError + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultError - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultError + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultError#Multiple @@ -920,15 +734,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchProperties#Multiple - - - @@ -948,9 +759,6 @@ - - AppliedScope - AppliedScopeType @@ -972,9 +780,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetail + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetail - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetail + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetail#Multiple @@ -1006,9 +814,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price#Multiple @@ -1034,9 +842,67 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ProxyResource - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ProxyResource#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest + + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest#Multiple @@ -1056,18 +922,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestProperties#Multiple - - - @@ -1099,9 +962,6 @@ AppliedScopeType - - AppliedScopes - BillingPlan @@ -1132,9 +992,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourceProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourceProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourceProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourceProperties#Multiple @@ -1154,9 +1014,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformation + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformation + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformation#Multiple @@ -1188,9 +1048,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyError + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyError - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyError + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyError#Multiple @@ -1216,9 +1076,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundRequestProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundRequestProperties#Multiple @@ -1250,9 +1110,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponseProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponseProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponseProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponseProperties#Multiple @@ -1278,9 +1138,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseBillingCurrencyTotal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseBillingCurrencyTotal - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseBillingCurrencyTotal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseBillingCurrencyTotal#Multiple @@ -1306,9 +1166,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponsePricingCurrencyTotal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponsePricingCurrencyTotal - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponsePricingCurrencyTotal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponsePricingCurrencyTotal#Multiple @@ -1334,9 +1194,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationList + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationList - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationList + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationList#Multiple @@ -1356,18 +1216,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationMergeProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationMergeProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationMergeProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationMergeProperties#Multiple - - - @@ -1375,18 +1232,15 @@ MergeDestination - - MergeSources - - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderBillingPlanInformation + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderBillingPlanInformation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderBillingPlanInformation + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderBillingPlanInformation#Multiple @@ -1412,9 +1266,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderList + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderList - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderList + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderList#Multiple @@ -1434,9 +1288,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderProperties#Multiple @@ -1516,9 +1370,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderResponse + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponse - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderResponse + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponse#Multiple @@ -1562,9 +1416,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponse + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponse + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse#Multiple @@ -1620,21 +1474,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsListResult + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsIdentity - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsListResult + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsIdentity#Multiple - + + + + + + + - NextLink + ReservationId + + + ReservationOrderId + + + SubscriptionId @@ -1642,15 +1508,34 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSplitProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsListResult - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSplitProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsListResult#Multiple - + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSplitProperties + + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSplitProperties#Multiple + + + @@ -1658,9 +1543,6 @@ - - SplitDestinations - SplitSource @@ -1670,15 +1552,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsProperties#Multiple - - - @@ -1764,9 +1643,6 @@ - - AppliedScope - AppliedScopeType @@ -1854,9 +1730,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesUtilization + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesUtilization - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesUtilization + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesUtilization#Multiple @@ -1876,9 +1752,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSummary + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSummary - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSummary + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSummary#Multiple @@ -1946,9 +1822,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSwapProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSwapProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSwapProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSwapProperties#Multiple @@ -1974,9 +1850,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToExchange + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToExchange - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToExchange + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToExchange#Multiple @@ -2002,9 +1878,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseExchange + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseExchange - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseExchange + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseExchange#Multiple @@ -2036,9 +1912,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturn + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturn - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturn + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturn#Multiple @@ -2064,9 +1940,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnForExchange + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnForExchange - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnForExchange + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnForExchange#Multiple @@ -2098,9 +1974,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationUtilizationAggregates + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationUtilizationAggregates - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationUtilizationAggregates + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationUtilizationAggregates#Multiple @@ -2138,9 +2014,31 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Resource + + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Resource#Multiple + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestProperties#Multiple @@ -2184,9 +2082,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseExchange + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseExchange - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseExchange + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseExchange#Multiple @@ -2218,9 +2116,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ScopeProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ScopeProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ScopeProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ScopeProperties#Multiple @@ -2246,9 +2144,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuCapability + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuCapability - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuCapability + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuCapability#Multiple @@ -2274,9 +2172,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName#Multiple @@ -2296,9 +2194,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuProperty + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuProperty + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuProperty#Multiple @@ -2324,9 +2222,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuRestriction + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuRestriction - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuRestriction + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuRestriction#Multiple @@ -2352,15 +2250,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SplitProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SplitProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SplitProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SplitProperties#Multiple - - - @@ -2368,9 +2263,6 @@ - - Quantity - ReservationId @@ -2380,9 +2272,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemData + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemData - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemData + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemData#Multiple diff --git a/generated/Reservations/Reservations.Autorest/Az.Reservations.psd1 b/generated/Reservations/Reservations.Autorest/Az.Reservations.psd1 index 256b6df38fb8..a135872cd779 100644 --- a/generated/Reservations/Reservations.Autorest/Az.Reservations.psd1 +++ b/generated/Reservations/Reservations.Autorest/Az.Reservations.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.Reservations.private.dll' FormatsToProcess = './Az.Reservations.format.ps1xml' - FunctionsToExport = 'Get-AzReservation', 'Get-AzReservationAvailableScope', 'Get-AzReservationCatalog', 'Get-AzReservationHistory', 'Get-AzReservationOrder', 'Get-AzReservationOrderId', 'Get-AzReservationQuote', 'Invoke-AzReservationArchiveReservation', 'Invoke-AzReservationCalculateExchange', 'Invoke-AzReservationCalculateRefund', 'Invoke-AzReservationExchange', 'Invoke-AzReservationReturn', 'Invoke-AzReservationUnarchiveReservation', 'Merge-AzReservation', 'Move-AzReservationDirectory', 'New-AzReservation', 'Split-AzReservation', 'Update-AzReservation', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzReservation', 'Get-AzReservationAvailableScope', 'Get-AzReservationCatalog', 'Get-AzReservationHistory', 'Get-AzReservationOrder', 'Get-AzReservationOrderId', 'Get-AzReservationQuote', 'Invoke-AzReservationArchiveReservation', 'Invoke-AzReservationCalculateExchange', 'Invoke-AzReservationCalculateRefund', 'Invoke-AzReservationExchange', 'Invoke-AzReservationReturn', 'Invoke-AzReservationUnarchiveReservation', 'Merge-AzReservation', 'Move-AzReservationDirectory', 'New-AzReservation', 'Split-AzReservation', 'Update-AzReservation' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Reservations' diff --git a/generated/Reservations/Reservations.Autorest/Properties/AssemblyInfo.cs b/generated/Reservations/Reservations.Autorest/Properties/AssemblyInfo.cs index 014de140746b..c35f0587b3e7 100644 --- a/generated/Reservations/Reservations.Autorest/Properties/AssemblyInfo.cs +++ b/generated/Reservations/Reservations.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,30 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an ""AS IS"" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// ---------------------------------------------------------------------------------- +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. using System; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Microsoft Azure Powershell - Reservations")] -[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] -[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] -[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] +[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] +[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] +[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] +[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Reservations")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.13.1")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.13.1")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] + + + -[assembly: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("6035c2bd-2183-4107-8f37-8395d134babd")] -[assembly: AssemblyVersion("0.13.1")] -[assembly: AssemblyFileVersion("0.13.1")] diff --git a/generated/Reservations/Reservations.Autorest/check-dependencies.ps1 b/generated/Reservations/Reservations.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Reservations/Reservations.Autorest/check-dependencies.ps1 +++ b/generated/Reservations/Reservations.Autorest/check-dependencies.ps1 @@ -12,13 +12,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) $ErrorActionPreference = 'Stop' -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } diff --git a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservation.ps1 b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservation.ps1 index a669e2540af5..26ca43d94354 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservation.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservation.ps1 @@ -27,7 +27,7 @@ Get-AzReservation -ReservationOrderId a87c1742-0080-5b4d-b953-8531ad46fdc8 -Rese .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -38,14 +38,21 @@ INPUTOBJECT : Identity Parameter [ReservationId ]: Id of the reservation item [ReservationOrderId ]: Order Id of the reservation [SubscriptionId ]: Id of the subscription + +RESERVATIONORDERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [ReservationId ]: Id of the reservation item + [ReservationOrderId ]: Order Id of the reservation + [SubscriptionId ]: Id of the subscription .Link https://learn.microsoft.com/powershell/module/az.reservations/get-azreservation #> function Get-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityReservationOrder', Mandatory)] [Alias('ReservationId')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] @@ -64,11 +71,17 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityReservationOrder', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] + # Identity Parameter + ${ReservationOrderInputObject}, + [Parameter(ParameterSetName='Get')] [Parameter(ParameterSetName='GetViaIdentity')] + [Parameter(ParameterSetName='GetViaIdentityReservationOrder')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')] [System.String] # Supported value of this query is renewProperties @@ -163,6 +176,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -184,6 +206,7 @@ begin { $mapping = @{ Get = 'Az.Reservations.private\Get-AzReservation_Get'; GetViaIdentity = 'Az.Reservations.private\Get-AzReservation_GetViaIdentity'; + GetViaIdentityReservationOrder = 'Az.Reservations.private\Get-AzReservation_GetViaIdentityReservationOrder'; List = 'Az.Reservations.private\Get-AzReservation_List'; List1 = 'Az.Reservations.private\Get-AzReservation_List1'; } @@ -194,6 +217,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationAvailableScope.ps1 b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationAvailableScope.ps1 index e4353d692dec..b43a969b5323 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationAvailableScope.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationAvailableScope.ps1 @@ -22,70 +22,83 @@ Check whether the scopes from request is valid for `Reservation`.\n .Example Get-AzReservationAvailableScope -ReservationId 2ef560a7-f469-4b62-87b7-5312d588ce2a -ReservationOrderId 2b9b9372-24e1-4a07-a354-2078fe347cf9 -Scope "/subscriptions/3f0487ff-27ca-4b9c-2a23-000770724b1b" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties .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. -BODY : Available scope - [Scope ]: - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item [ReservationOrderId ]: Order Id of the reservation [SubscriptionId ]: Id of the subscription + +RESERVATIONORDERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [ReservationId ]: Id of the reservation item + [ReservationOrderId ]: Order Id of the reservation + [SubscriptionId ]: Id of the subscription .Link https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationavailablescope #> function Get-AzReservationAvailableScope { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties])] [CmdletBinding(DefaultParameterSetName='AvailableExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Available', Mandatory)] [Parameter(ParameterSetName='AvailableExpanded', Mandatory)] + [Parameter(ParameterSetName='AvailableViaIdentityReservationOrderExpanded', Mandatory)] + [Parameter(ParameterSetName='AvailableViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='AvailableViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Id of the reservation item ${ReservationId}, - [Parameter(ParameterSetName='Available', Mandatory)] [Parameter(ParameterSetName='AvailableExpanded', Mandatory)] + [Parameter(ParameterSetName='AvailableViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='AvailableViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${ReservationOrderId}, - [Parameter(ParameterSetName='AvailableViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='AvailableViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Available', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='AvailableViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest] - # Available scope - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, + [Parameter(ParameterSetName='AvailableViaIdentityReservationOrderExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] + # Identity Parameter + ${ReservationOrderInputObject}, [Parameter(ParameterSetName='AvailableExpanded')] [Parameter(ParameterSetName='AvailableViaIdentityExpanded')] + [Parameter(ParameterSetName='AvailableViaIdentityReservationOrderExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String[]] # . ${Scope}, + [Parameter(ParameterSetName='AvailableViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Available operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='AvailableViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Available operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -154,6 +167,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -173,10 +195,11 @@ begin { } $mapping = @{ - Available = 'Az.Reservations.private\Get-AzReservationAvailableScope_Available'; AvailableExpanded = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableExpanded'; - AvailableViaIdentity = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentity'; AvailableViaIdentityExpanded = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentityExpanded'; + AvailableViaIdentityReservationOrderExpanded = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded'; + AvailableViaJsonFilePath = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaJsonFilePath'; + AvailableViaJsonString = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -185,6 +208,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationCatalog.ps1 b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationCatalog.ps1 index 4026e2763f42..7313998f68dd 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationCatalog.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationCatalog.ps1 @@ -29,7 +29,7 @@ Get-AzReservationCatalog -SubscriptionId "10000000-aaaa-bbbb-cccc-100000000001" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog .Notes COMPLEX PARAMETER PROPERTIES @@ -44,7 +44,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationcatalog #> function Get-AzReservationCatalog { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get')] @@ -58,7 +58,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -167,6 +166,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -189,9 +197,7 @@ begin { Get = 'Az.Reservations.private\Get-AzReservationCatalog_Get'; GetViaIdentity = 'Az.Reservations.private\Get-AzReservationCatalog_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -205,6 +211,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationHistory.ps1 b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationHistory.ps1 index 299f54db2dab..b9e8af625500 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationHistory.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationHistory.ps1 @@ -23,12 +23,12 @@ List of all the revisions for the `Reservation`. Get-AzReservationHistory -ReservationId 2ef560a7-f469-4b62-87b7-5312d588ce2a -ReservationOrderId 2b9b9372-24e1-4a07-a354-2078fe347cf9 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationhistory #> function Get-AzReservationHistory { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -99,6 +99,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -127,6 +136,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationOrder.ps1 b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationOrder.ps1 index b73692ff7426..daef2180104e 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationOrder.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationOrder.ps1 @@ -27,7 +27,7 @@ Get-AzReservationOrder -ReservationOrderId 179de21b-90ec-4fe4-9423-f804b856dfee .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -42,7 +42,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationorder #> function Get-AzReservationOrder { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -56,7 +56,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Get')] @@ -122,6 +121,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -152,6 +160,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationOrderId.ps1 b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationOrderId.ps1 index 33e9f1948e73..c29e75c3f437 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationOrderId.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationOrderId.ps1 @@ -25,7 +25,7 @@ Get-AzReservationOrderId -SubscriptionId '10000000-aaaa-bbbb-cccc-100000000005' .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations .Notes COMPLEX PARAMETER PROPERTIES @@ -40,7 +40,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationorderid #> function Get-AzReservationOrderId { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get')] @@ -54,7 +54,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -113,6 +112,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -135,9 +143,7 @@ begin { Get = 'Az.Reservations.private\Get-AzReservationOrderId_Get'; GetViaIdentity = 'Az.Reservations.private\Get-AzReservationOrderId_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -151,6 +157,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationQuote.ps1 b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationQuote.ps1 index 4612c807db22..dd25eadbf04b 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationQuote.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Get-AzReservationQuote.ps1 @@ -24,48 +24,15 @@ Get-AzReservationQuote -AppliedScopeType 'Shared' -BillingPlan 'Upfront' -billin .Example Get-AzReservationQuote -AppliedScopeType 'Shared' -BillingPlan 'Monthly' -billingScopeId '/subscriptions/b0f278e1-1f18-4378-84d7-b44dfa708665' -DisplayName 'yourRIName' -Location 'westus' -Quantity 1 -ReservedResourceType 'VirtualMachines' -Sku 'Standard_b1ls' -Term 'P1Y' -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties -.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. - -BODY : The request for reservation purchase - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. - [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan - [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. - [Location ]: The Azure region where the reserved resource lives. - [Quantity ]: Quantity of the skus that are part of the reservation. - [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. - [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. - [Sku ]: - [Term ]: Represent the term of reservation. +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationquote #> function Get-AzReservationQuote { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse])] [CmdletBinding(DefaultParameterSetName='CalculateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Calculate', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest] - # The request for reservation purchase - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='CalculateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] @@ -106,16 +73,16 @@ param( ${AppliedScopePropertyTenantId}, [Parameter(ParameterSetName='CalculateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType] + [System.String] # Type of the Applied Scope. ${AppliedScopeType}, [Parameter(ParameterSetName='CalculateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan] + [System.String] # Represent the billing plans. ${BillingPlan}, @@ -132,9 +99,9 @@ param( ${DisplayName}, [Parameter(ParameterSetName='CalculateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility] + [System.String] # Turning this on will apply the reservation discount to other VMs in the same VM size group. # Only specify for VirtualMachines reserved resource type. ${InstanceFlexibility}, @@ -158,9 +125,9 @@ param( ${Renew}, [Parameter(ParameterSetName='CalculateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType] + [System.String] # The type of the resource that is being reserved. ${ReservedResourceType}, @@ -177,12 +144,24 @@ param( ${Sku}, [Parameter(ParameterSetName='CalculateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm] + [System.String] # Represent the term of reservation. ${Term}, + [Parameter(ParameterSetName='CalculateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Calculate operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CalculateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Calculate operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -239,6 +218,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -258,8 +246,9 @@ begin { } $mapping = @{ - Calculate = 'Az.Reservations.private\Get-AzReservationQuote_Calculate'; CalculateExpanded = 'Az.Reservations.private\Get-AzReservationQuote_CalculateExpanded'; + CalculateViaJsonFilePath = 'Az.Reservations.private\Get-AzReservationQuote_CalculateViaJsonFilePath'; + CalculateViaJsonString = 'Az.Reservations.private\Get-AzReservationQuote_CalculateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -268,6 +257,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationArchiveReservation.ps1 b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationArchiveReservation.ps1 index da264d154797..06260ceca316 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationArchiveReservation.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationArchiveReservation.ps1 @@ -36,6 +36,12 @@ INPUTOBJECT : Identity Parameter [ReservationId ]: Id of the reservation item [ReservationOrderId ]: Order Id of the reservation [SubscriptionId ]: Id of the subscription + +RESERVATIONORDERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [ReservationId ]: Id of the reservation item + [ReservationOrderId ]: Order Id of the reservation + [SubscriptionId ]: Id of the subscription .Link https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationarchivereservation #> @@ -44,6 +50,7 @@ function Invoke-AzReservationArchiveReservation { [CmdletBinding(DefaultParameterSetName='Archive', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Archive', Mandatory)] + [Parameter(ParameterSetName='ArchiveViaIdentityReservationOrder', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Id of the reservation item @@ -59,9 +66,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='ArchiveViaIdentityReservationOrder', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] + # Identity Parameter + ${ReservationOrderInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -124,6 +136,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -145,6 +166,7 @@ begin { $mapping = @{ Archive = 'Az.Reservations.private\Invoke-AzReservationArchiveReservation_Archive'; ArchiveViaIdentity = 'Az.Reservations.private\Invoke-AzReservationArchiveReservation_ArchiveViaIdentity'; + ArchiveViaIdentityReservationOrder = 'Az.Reservations.private\Invoke-AzReservationArchiveReservation_ArchiveViaIdentityReservationOrder'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -153,6 +175,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationCalculateExchange.ps1 b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationCalculateExchange.ps1 index 6df53d74f6bd..72d1e719ff21 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationCalculateExchange.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationCalculateExchange.ps1 @@ -61,54 +61,13 @@ $reservationsToPurchase = @($reservationToPurchase1, $reservationToPurchase2) Invoke-AzReservationCalculateExchange -ReservationsToExchange $reservationsToReturn -ReservationsToPurchase $reservationsToPurchase -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse .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. -BODY : Calculate exchange request - [ReservationsToExchange ]: List of reservations that are being returned in this exchange. - [Quantity ]: Quantity to be returned. Must be greater than zero. - [ReservationId ]: Fully qualified identifier of the reservation being returned - [ReservationsToPurchase ]: List of reservations that are being purchased in this exchange. - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. - [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan - [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. - [Location ]: The Azure region where the reserved resource lives. - [Quantity ]: Quantity of the skus that are part of the reservation. - [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. - [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. - [Sku ]: - [Term ]: Represent the term of reservation. - [SavingsPlansToPurchase ]: List of savings plans that are being purchased in this exchange. - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [BillingPlan ]: Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. - [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan - [CommitmentAmount ]: - [CommitmentCurrencyCode ]: The ISO 4217 3-letter currency code for the currency used by this purchase record. - [CommitmentGrain ]: Commitment grain. - [DisplayName ]: Friendly name of the savings plan - [SkuName ]: - [Term ]: Represent savings plan term in ISO 8601 format. - RESERVATIONSTOEXCHANGE : List of reservations that are being returned in this exchange. [Quantity ]: Quantity to be returned. Must be greater than zero. [ReservationId ]: Fully qualified identifier of the reservation being returned @@ -119,19 +78,19 @@ RESERVATIONSTOPURCHASE : List of reservations that are being [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. + [AppliedScopeType ]: Type of the Applied Scope. + [AppliedScopes >]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. + [BillingPlan ]: Represent the billing plans. [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. + [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. [Location ]: The Azure region where the reserved resource lives. [Quantity ]: Quantity of the skus that are part of the reservation. [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. + [ReservedResourceType ]: The type of the resource that is being reserved. [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. [Sku ]: - [Term ]: Represent the term of reservation. + [Term ]: Represent the term of reservation. SAVINGSPLANSTOPURCHASE : List of savings plans that are being purchased in this exchange. [AppliedScopePropertyDisplayName ]: Display name @@ -139,53 +98,55 @@ SAVINGSPLANSTOPURCHASE : List of savings plans th [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [BillingPlan ]: Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. + [AppliedScopeType ]: Type of the Applied Scope. + [BillingPlan ]: Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan [CommitmentAmount ]: [CommitmentCurrencyCode ]: The ISO 4217 3-letter currency code for the currency used by this purchase record. - [CommitmentGrain ]: Commitment grain. + [CommitmentGrain ]: Commitment grain. [DisplayName ]: Friendly name of the savings plan [SkuName ]: - [Term ]: Represent savings plan term in ISO 8601 format. + [Term ]: Represent savings plan term in ISO 8601 format. .Link https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationcalculateexchange #> function Invoke-AzReservationCalculateExchange { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse])] [CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Post', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest] - # Calculate exchange request - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='PostExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[]] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn[]] # List of reservations that are being returned in this exchange. - # To construct, see NOTES section for RESERVATIONSTOEXCHANGE properties and create a hash table. ${ReservationsToExchange}, [Parameter(ParameterSetName='PostExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[]] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest[]] # List of reservations that are being purchased in this exchange. - # To construct, see NOTES section for RESERVATIONSTOPURCHASE properties and create a hash table. ${ReservationsToPurchase}, [Parameter(ParameterSetName='PostExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[]] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest[]] # List of savings plans that are being purchased in this exchange. - # To construct, see NOTES section for SAVINGSPLANSTOPURCHASE properties and create a hash table. ${SavingsPlansToPurchase}, + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Post operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Post operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -254,6 +215,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -273,8 +243,9 @@ begin { } $mapping = @{ - Post = 'Az.Reservations.private\Invoke-AzReservationCalculateExchange_Post'; PostExpanded = 'Az.Reservations.private\Invoke-AzReservationCalculateExchange_PostExpanded'; + PostViaJsonFilePath = 'Az.Reservations.private\Invoke-AzReservationCalculateExchange_PostViaJsonFilePath'; + PostViaJsonString = 'Az.Reservations.private\Invoke-AzReservationCalculateExchange_PostViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -283,6 +254,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationCalculateRefund.ps1 b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationCalculateRefund.ps1 index 9c74dbba8ce9..422f459ff7d0 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationCalculateRefund.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationCalculateRefund.ps1 @@ -26,23 +26,15 @@ $fullyQualifiedOrderId = "/providers/microsoft.capacity/reservationOrders/500000 Invoke-AzReservationCalculateRefund -ReservationOrderId $orderId -ReservationToReturnQuantity 1 -ReservationToReturnReservationId $fullyQualifiedId -Id $fullyQualifiedOrderId -Scope "Reservation" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse .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. -BODY : Request containing information needed for calculating refund. - [Id ]: Fully qualified identifier of the reservation order being returned - [ReservationToReturnQuantity ]: Quantity to be returned. Must be greater than zero. - [ReservationToReturnReservationId ]: Fully qualified identifier of the reservation being returned - [Scope ]: The scope of the refund, e.g. Reservation - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -52,32 +44,23 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationcalculaterefund #> function Invoke-AzReservationCalculateRefund { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse])] [CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Post', Mandatory)] [Parameter(ParameterSetName='PostExpanded', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${ReservationOrderId}, - [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Post', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest] - # Request containing information needed for calculating refund. - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='PostExpanded')] [Parameter(ParameterSetName='PostViaIdentityExpanded')] [Alias('ReservationId')] @@ -109,6 +92,18 @@ param( # Reservation ${Scope}, + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Post operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Post operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -165,6 +160,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -184,10 +188,10 @@ begin { } $mapping = @{ - Post = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_Post'; PostExpanded = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_PostExpanded'; - PostViaIdentity = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_PostViaIdentity'; PostViaIdentityExpanded = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_PostViaIdentityExpanded'; + PostViaJsonFilePath = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_PostViaJsonFilePath'; + PostViaJsonString = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_PostViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -196,6 +200,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationExchange.ps1 b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationExchange.ps1 index b0bbdb245daa..4c57d98d3a7e 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationExchange.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationExchange.ps1 @@ -22,37 +22,33 @@ Returns one or more `Reservations` in exchange for one or more `Reservation` pur .Example Invoke-AzReservationExchange -SessionId 8982593c-679e-4d4e-b971-c48b6d824cba -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse -.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. - -BODY : Exchange request - [SessionId ]: SessionId that was returned by CalculateExchange API. +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationexchange #> function Invoke-AzReservationExchange { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse])] [CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Post', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest] - # Exchange request - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='PostExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # SessionId that was returned by CalculateExchange API. ${SessionId}, + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Post operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Post operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -121,6 +117,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -140,8 +145,9 @@ begin { } $mapping = @{ - Post = 'Az.Reservations.private\Invoke-AzReservationExchange_Post'; PostExpanded = 'Az.Reservations.private\Invoke-AzReservationExchange_PostExpanded'; + PostViaJsonFilePath = 'Az.Reservations.private\Invoke-AzReservationExchange_PostViaJsonFilePath'; + PostViaJsonString = 'Az.Reservations.private\Invoke-AzReservationExchange_PostViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -150,6 +156,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationReturn.ps1 b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationReturn.ps1 index a1738940b0b9..e04c89f80ae6 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationReturn.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationReturn.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Return a Reservation. +Return a reservation and get refund information. .Description -Return a Reservation. +Return a reservation and get refund information. .Example $orderId = "50000000-aaaa-bbbb-cccc-100000000003" $fullyQualifiedId = "/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000003/reservations/30000000-aaaa-bbbb-cccc-100000000003" @@ -29,19 +29,12 @@ Invoke-AzReservationCalculateRefund -ReservationOrderId $orderId -ReservationToR .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse .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. -BODY : The return request body. - [ReservationToReturnQuantity ]: Quantity to be returned. Must be greater than zero. - [ReservationToReturnReservationId ]: Fully qualified identifier of the reservation being returned - [ReturnReason ]: The reason of returning the reservation - [Scope ]: The scope of the refund, e.g. Reservation - [SessionId ]: SessionId that was returned by CalculateRefund API. - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -51,48 +44,48 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationreturn #> function Invoke-AzReservationReturn { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse])] [CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( + [Parameter(ParameterSetName='PostExpanded', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [System.String] + # Order Id of the reservation + ${ReservationOrderId}, + [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='PostExpanded', Mandatory)] - [Parameter(ParameterSetName='Post', Mandatory)] + [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [System.String] - # Reservation Order Id. - ${ReservationOrderId}, + [System.Int32] + # Quantity to be returned. + # Must be greater than zero. + ${ReservationToReturnQuantity}, [Parameter(ParameterSetName='PostExpanded', Mandatory)] [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] - # Reservation Id to return. + # Fully qualified identifier of the reservation being returned ${ReservationToReturnReservationId}, - [Parameter(ParameterSetName='PostExpanded', Mandatory)] - [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [System.Int32] - # Quantity to return. - ${ReservationToReturnQuantity}, - [Parameter(ParameterSetName='PostExpanded', Mandatory)] [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] - # The session id obtained from Invoke-AzReservationCalculateRefund.. - ${SessionId}, + # The reason of returning the reservation + ${ReturnReason}, [Parameter(ParameterSetName='PostExpanded', Mandatory)] [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory)] @@ -108,24 +101,28 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] - # The reason for this reservation return. - ${ReturnReason}, + # The session id obtained from Invoke-AzReservationCalculateRefund.. + ${SessionId}, - [Parameter(ParameterSetName='Post', Mandatory)] - [Parameter(ParameterSetName='PostViaIdentity', Mandatory)] - [ValidateNotNull()] + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Post operation + ${JsonString}, + + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest] - # The return request body. - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, + [System.String] + # Path of Json file supplied to the Post operation + ${JsonFilePath}, [Parameter(DontShow)] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -175,6 +172,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -195,9 +201,9 @@ begin { $mapping = @{ PostExpanded = 'Az.Reservations.custom\Invoke-AzReservationReturn'; - Post = 'Az.Reservations.custom\Invoke-AzReservationReturn'; + PostViaJsonString = 'Az.Reservations.custom\Invoke-AzReservationReturn'; + PostViaJsonFilePath = 'Az.Reservations.custom\Invoke-AzReservationReturn'; PostViaIdentityExpanded = 'Az.Reservations.custom\Invoke-AzReservationReturn'; - PostViaIdentity = 'Az.Reservations.custom\Invoke-AzReservationReturn'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -206,6 +212,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationUnarchiveReservation.ps1 b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationUnarchiveReservation.ps1 index 7dafc713ce3a..467c361a1973 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationUnarchiveReservation.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Invoke-AzReservationUnarchiveReservation.ps1 @@ -36,6 +36,12 @@ INPUTOBJECT : Identity Parameter [ReservationId ]: Id of the reservation item [ReservationOrderId ]: Order Id of the reservation [SubscriptionId ]: Id of the subscription + +RESERVATIONORDERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [ReservationId ]: Id of the reservation item + [ReservationOrderId ]: Order Id of the reservation + [SubscriptionId ]: Id of the subscription .Link https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationunarchivereservation #> @@ -44,6 +50,7 @@ function Invoke-AzReservationUnarchiveReservation { [CmdletBinding(DefaultParameterSetName='Unarchive', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Unarchive', Mandatory)] + [Parameter(ParameterSetName='UnarchiveViaIdentityReservationOrder', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Id of the reservation item @@ -59,9 +66,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UnarchiveViaIdentityReservationOrder', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] + # Identity Parameter + ${ReservationOrderInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -124,6 +136,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -145,6 +166,7 @@ begin { $mapping = @{ Unarchive = 'Az.Reservations.private\Invoke-AzReservationUnarchiveReservation_Unarchive'; UnarchiveViaIdentity = 'Az.Reservations.private\Invoke-AzReservationUnarchiveReservation_UnarchiveViaIdentity'; + UnarchiveViaIdentityReservationOrder = 'Az.Reservations.private\Invoke-AzReservationUnarchiveReservation_UnarchiveViaIdentityReservationOrder'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -153,6 +175,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Merge-AzReservation.ps1 b/generated/Reservations/Reservations.Autorest/exports/Merge-AzReservation.ps1 index be126b004be7..7ddc964951ad 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Merge-AzReservation.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Merge-AzReservation.ps1 @@ -24,12 +24,12 @@ $arr=@("72bc398d-b201-4a2e-a1fa-60fb48a85b23", "34f2474f-b4d7-41ec-a96d-d4bb7c2f Merge-AzReservation -ReservationOrderId "79ebddac-4030-4296-ab93-1ad90f032058" -ReservationId $arr .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/merge-azreservation #> function Merge-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -102,6 +102,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -130,6 +139,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Move-AzReservationDirectory.ps1 b/generated/Reservations/Reservations.Autorest/exports/Move-AzReservationDirectory.ps1 index f8530017e8cc..0e3b00720a11 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Move-AzReservationDirectory.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Move-AzReservationDirectory.ps1 @@ -22,20 +22,15 @@ Change directory (tenant) of `ReservationOrder` and all `Reservation` under it t .Example Move-AzReservationDirectory -ReservationOrderId "7c31a9e8-8490-4002-88cd-3a16b71362a9" -DestinationTenantId "f65fbe9a-14b0-44c6-8c0d-2ef2c4543040" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse .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. -BODY : Request body for change directory of a reservation. - [DestinationTenantId ]: Tenant id GUID that reservation order is to be transferred to - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -45,32 +40,23 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/move-azreservationdirectory #> function Move-AzReservationDirectory { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse])] [CmdletBinding(DefaultParameterSetName='ChangeExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Change', Mandatory)] [Parameter(ParameterSetName='ChangeExpanded', Mandatory)] + [Parameter(ParameterSetName='ChangeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ChangeViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${ReservationOrderId}, - [Parameter(ParameterSetName='ChangeViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='ChangeViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Change', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='ChangeViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest] - # Request body for change directory of a reservation. - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='ChangeExpanded')] [Parameter(ParameterSetName='ChangeViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] @@ -78,6 +64,18 @@ param( # Tenant id GUID that reservation order is to be transferred to ${DestinationTenantId}, + [Parameter(ParameterSetName='ChangeViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Change operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='ChangeViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Change operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -134,6 +132,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -153,10 +160,10 @@ begin { } $mapping = @{ - Change = 'Az.Reservations.private\Move-AzReservationDirectory_Change'; ChangeExpanded = 'Az.Reservations.private\Move-AzReservationDirectory_ChangeExpanded'; - ChangeViaIdentity = 'Az.Reservations.private\Move-AzReservationDirectory_ChangeViaIdentity'; ChangeViaIdentityExpanded = 'Az.Reservations.private\Move-AzReservationDirectory_ChangeViaIdentityExpanded'; + ChangeViaJsonFilePath = 'Az.Reservations.private\Move-AzReservationDirectory_ChangeViaJsonFilePath'; + ChangeViaJsonString = 'Az.Reservations.private\Move-AzReservationDirectory_ChangeViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -165,6 +172,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/New-AzReservation.ps1 b/generated/Reservations/Reservations.Autorest/exports/New-AzReservation.ps1 index d15c4fc13c11..82d03e1c9796 100644 --- a/generated/Reservations/Reservations.Autorest/exports/New-AzReservation.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/New-AzReservation.ps1 @@ -16,43 +16,21 @@ <# .Synopsis -Purchase `ReservationOrder` and create resource under the specified URI. +Purchase `ReservationOrder` and purchase resource under the specified URI. .Description -Purchase `ReservationOrder` and create resource under the specified URI. +Purchase `ReservationOrder` and purchase resource under the specified URI. .Example New-AzReservation -AppliedScopeType 'Shared' -BillingPlan 'Upfront' -billingScopeId '/subscriptions/b0f278e1-1f18-4378-84d7-b44dfa708665' -DisplayName 'TestVm2222' -Location 'westus' -Quantity 1 -ReservedResourceType 'VirtualMachines' -Sku 'Standard_b1ls' -Term 'P1Y' -ReservationOrderId '846655fa-d9e7-4fb8-9512-3ab7367352f1' -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse .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. -BODY : The request for reservation purchase - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. - [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan - [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. - [Location ]: The Azure region where the reserved resource lives. - [Quantity ]: Quantity of the skus that are part of the reservation. - [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. - [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. - [Sku ]: - [Term ]: Represent the term of reservation. - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -62,32 +40,23 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/new-azreservation #> function New-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse])] [CmdletBinding(DefaultParameterSetName='PurchaseExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Purchase', Mandatory)] [Parameter(ParameterSetName='PurchaseExpanded', Mandatory)] + [Parameter(ParameterSetName='PurchaseViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PurchaseViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${ReservationOrderId}, - [Parameter(ParameterSetName='PurchaseViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Purchase', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='PurchaseViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest] - # The request for reservation purchase - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] [AllowEmptyCollection()] @@ -135,17 +104,17 @@ param( [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType] + [System.String] # Type of the Applied Scope. ${AppliedScopeType}, [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan] + [System.String] # Represent the billing plans. ${BillingPlan}, @@ -165,9 +134,9 @@ param( [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility] + [System.String] # Turning this on will apply the reservation discount to other VMs in the same VM size group. # Only specify for VirtualMachines reserved resource type. ${InstanceFlexibility}, @@ -195,9 +164,9 @@ param( [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType] + [System.String] # The type of the resource that is being reserved. ${ReservedResourceType}, @@ -217,12 +186,24 @@ param( [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm] + [System.String] # Represent the term of reservation. ${Term}, + [Parameter(ParameterSetName='PurchaseViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Purchase operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PurchaseViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Purchase operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -291,6 +272,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -310,10 +300,10 @@ begin { } $mapping = @{ - Purchase = 'Az.Reservations.private\New-AzReservation_Purchase'; PurchaseExpanded = 'Az.Reservations.private\New-AzReservation_PurchaseExpanded'; - PurchaseViaIdentity = 'Az.Reservations.private\New-AzReservation_PurchaseViaIdentity'; PurchaseViaIdentityExpanded = 'Az.Reservations.private\New-AzReservation_PurchaseViaIdentityExpanded'; + PurchaseViaJsonFilePath = 'Az.Reservations.private\New-AzReservation_PurchaseViaJsonFilePath'; + PurchaseViaJsonString = 'Az.Reservations.private\New-AzReservation_PurchaseViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -322,6 +312,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Reservations/Reservations.Autorest/exports/ProxyCmdletDefinitions.ps1 index 5b7ecfdae8fa..975bd81f9025 100644 --- a/generated/Reservations/Reservations.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -22,70 +22,83 @@ Check whether the scopes from request is valid for `Reservation`.\n .Example Get-AzReservationAvailableScope -ReservationId 2ef560a7-f469-4b62-87b7-5312d588ce2a -ReservationOrderId 2b9b9372-24e1-4a07-a354-2078fe347cf9 -Scope "/subscriptions/3f0487ff-27ca-4b9c-2a23-000770724b1b" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties .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. -BODY : Available scope - [Scope ]: - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item [ReservationOrderId ]: Order Id of the reservation [SubscriptionId ]: Id of the subscription + +RESERVATIONORDERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [ReservationId ]: Id of the reservation item + [ReservationOrderId ]: Order Id of the reservation + [SubscriptionId ]: Id of the subscription .Link https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationavailablescope #> function Get-AzReservationAvailableScope { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties])] [CmdletBinding(DefaultParameterSetName='AvailableExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Available', Mandatory)] [Parameter(ParameterSetName='AvailableExpanded', Mandatory)] + [Parameter(ParameterSetName='AvailableViaIdentityReservationOrderExpanded', Mandatory)] + [Parameter(ParameterSetName='AvailableViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='AvailableViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Id of the reservation item ${ReservationId}, - [Parameter(ParameterSetName='Available', Mandatory)] [Parameter(ParameterSetName='AvailableExpanded', Mandatory)] + [Parameter(ParameterSetName='AvailableViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='AvailableViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${ReservationOrderId}, - [Parameter(ParameterSetName='AvailableViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='AvailableViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Available', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='AvailableViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest] - # Available scope - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, + [Parameter(ParameterSetName='AvailableViaIdentityReservationOrderExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] + # Identity Parameter + ${ReservationOrderInputObject}, [Parameter(ParameterSetName='AvailableExpanded')] [Parameter(ParameterSetName='AvailableViaIdentityExpanded')] + [Parameter(ParameterSetName='AvailableViaIdentityReservationOrderExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String[]] # . ${Scope}, + [Parameter(ParameterSetName='AvailableViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Available operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='AvailableViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Available operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -154,6 +167,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -173,10 +195,11 @@ begin { } $mapping = @{ - Available = 'Az.Reservations.private\Get-AzReservationAvailableScope_Available'; AvailableExpanded = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableExpanded'; - AvailableViaIdentity = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentity'; AvailableViaIdentityExpanded = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentityExpanded'; + AvailableViaIdentityReservationOrderExpanded = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded'; + AvailableViaJsonFilePath = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaJsonFilePath'; + AvailableViaJsonString = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -185,6 +208,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -243,7 +269,7 @@ Get-AzReservationCatalog -SubscriptionId "10000000-aaaa-bbbb-cccc-100000000001" .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog .Notes COMPLEX PARAMETER PROPERTIES @@ -258,7 +284,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationcatalog #> function Get-AzReservationCatalog { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get')] @@ -272,7 +298,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -381,6 +406,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -403,9 +437,7 @@ begin { Get = 'Az.Reservations.private\Get-AzReservationCatalog_Get'; GetViaIdentity = 'Az.Reservations.private\Get-AzReservationCatalog_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -419,6 +451,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -471,12 +506,12 @@ List of all the revisions for the `Reservation`. Get-AzReservationHistory -ReservationId 2ef560a7-f469-4b62-87b7-5312d588ce2a -ReservationOrderId 2b9b9372-24e1-4a07-a354-2078fe347cf9 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationhistory #> function Get-AzReservationHistory { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -547,6 +582,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -575,6 +619,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -629,7 +676,7 @@ Get-AzReservationOrderId -SubscriptionId '10000000-aaaa-bbbb-cccc-100000000005' .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations .Notes COMPLEX PARAMETER PROPERTIES @@ -644,7 +691,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationorderid #> function Get-AzReservationOrderId { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get')] @@ -658,7 +705,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -717,6 +763,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -739,9 +794,7 @@ begin { Get = 'Az.Reservations.private\Get-AzReservationOrderId_Get'; GetViaIdentity = 'Az.Reservations.private\Get-AzReservationOrderId_GetViaIdentity'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -755,6 +808,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -811,7 +867,7 @@ Get-AzReservationOrder -ReservationOrderId 179de21b-90ec-4fe4-9423-f804b856dfee .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -826,7 +882,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationorder #> function Get-AzReservationOrder { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -840,7 +896,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Get')] @@ -906,6 +961,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -936,6 +1000,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -989,48 +1056,15 @@ Get-AzReservationQuote -AppliedScopeType 'Shared' -BillingPlan 'Upfront' -billin .Example Get-AzReservationQuote -AppliedScopeType 'Shared' -BillingPlan 'Monthly' -billingScopeId '/subscriptions/b0f278e1-1f18-4378-84d7-b44dfa708665' -DisplayName 'yourRIName' -Location 'westus' -Quantity 1 -ReservedResourceType 'VirtualMachines' -Sku 'Standard_b1ls' -Term 'P1Y' -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties -.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. - -BODY : The request for reservation purchase - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. - [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan - [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. - [Location ]: The Azure region where the reserved resource lives. - [Quantity ]: Quantity of the skus that are part of the reservation. - [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. - [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. - [Sku ]: - [Term ]: Represent the term of reservation. +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationquote #> function Get-AzReservationQuote { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse])] [CmdletBinding(DefaultParameterSetName='CalculateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Calculate', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest] - # The request for reservation purchase - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='CalculateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] @@ -1071,16 +1105,16 @@ param( ${AppliedScopePropertyTenantId}, [Parameter(ParameterSetName='CalculateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType] + [System.String] # Type of the Applied Scope. ${AppliedScopeType}, [Parameter(ParameterSetName='CalculateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan] + [System.String] # Represent the billing plans. ${BillingPlan}, @@ -1097,9 +1131,9 @@ param( ${DisplayName}, [Parameter(ParameterSetName='CalculateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility] + [System.String] # Turning this on will apply the reservation discount to other VMs in the same VM size group. # Only specify for VirtualMachines reserved resource type. ${InstanceFlexibility}, @@ -1123,9 +1157,9 @@ param( ${Renew}, [Parameter(ParameterSetName='CalculateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType] + [System.String] # The type of the resource that is being reserved. ${ReservedResourceType}, @@ -1142,12 +1176,24 @@ param( ${Sku}, [Parameter(ParameterSetName='CalculateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm] + [System.String] # Represent the term of reservation. ${Term}, + [Parameter(ParameterSetName='CalculateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Calculate operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CalculateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Calculate operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1204,6 +1250,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1223,8 +1278,9 @@ begin { } $mapping = @{ - Calculate = 'Az.Reservations.private\Get-AzReservationQuote_Calculate'; CalculateExpanded = 'Az.Reservations.private\Get-AzReservationQuote_CalculateExpanded'; + CalculateViaJsonFilePath = 'Az.Reservations.private\Get-AzReservationQuote_CalculateViaJsonFilePath'; + CalculateViaJsonString = 'Az.Reservations.private\Get-AzReservationQuote_CalculateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1233,6 +1289,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1289,7 +1348,7 @@ Get-AzReservation -ReservationOrderId a87c1742-0080-5b4d-b953-8531ad46fdc8 -Rese .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -1300,14 +1359,21 @@ INPUTOBJECT : Identity Parameter [ReservationId ]: Id of the reservation item [ReservationOrderId ]: Order Id of the reservation [SubscriptionId ]: Id of the subscription + +RESERVATIONORDERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [ReservationId ]: Id of the reservation item + [ReservationOrderId ]: Order Id of the reservation + [SubscriptionId ]: Id of the subscription .Link https://learn.microsoft.com/powershell/module/az.reservations/get-azreservation #> function Get-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityReservationOrder', Mandatory)] [Alias('ReservationId')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] @@ -1326,11 +1392,17 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityReservationOrder', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] + # Identity Parameter + ${ReservationOrderInputObject}, + [Parameter(ParameterSetName='Get')] [Parameter(ParameterSetName='GetViaIdentity')] + [Parameter(ParameterSetName='GetViaIdentityReservationOrder')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')] [System.String] # Supported value of this query is renewProperties @@ -1425,6 +1497,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1446,6 +1527,7 @@ begin { $mapping = @{ Get = 'Az.Reservations.private\Get-AzReservation_Get'; GetViaIdentity = 'Az.Reservations.private\Get-AzReservation_GetViaIdentity'; + GetViaIdentityReservationOrder = 'Az.Reservations.private\Get-AzReservation_GetViaIdentityReservationOrder'; List = 'Az.Reservations.private\Get-AzReservation_List'; List1 = 'Az.Reservations.private\Get-AzReservation_List1'; } @@ -1456,6 +1538,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1521,6 +1606,12 @@ INPUTOBJECT : Identity Parameter [ReservationId ]: Id of the reservation item [ReservationOrderId ]: Order Id of the reservation [SubscriptionId ]: Id of the subscription + +RESERVATIONORDERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [ReservationId ]: Id of the reservation item + [ReservationOrderId ]: Order Id of the reservation + [SubscriptionId ]: Id of the subscription .Link https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationarchivereservation #> @@ -1529,6 +1620,7 @@ function Invoke-AzReservationArchiveReservation { [CmdletBinding(DefaultParameterSetName='Archive', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Archive', Mandatory)] + [Parameter(ParameterSetName='ArchiveViaIdentityReservationOrder', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Id of the reservation item @@ -1544,9 +1636,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='ArchiveViaIdentityReservationOrder', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] + # Identity Parameter + ${ReservationOrderInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1609,6 +1706,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1630,6 +1736,7 @@ begin { $mapping = @{ Archive = 'Az.Reservations.private\Invoke-AzReservationArchiveReservation_Archive'; ArchiveViaIdentity = 'Az.Reservations.private\Invoke-AzReservationArchiveReservation_ArchiveViaIdentity'; + ArchiveViaIdentityReservationOrder = 'Az.Reservations.private\Invoke-AzReservationArchiveReservation_ArchiveViaIdentityReservationOrder'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1638,6 +1745,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1728,54 +1838,13 @@ $reservationsToPurchase = @($reservationToPurchase1, $reservationToPurchase2) Invoke-AzReservationCalculateExchange -ReservationsToExchange $reservationsToReturn -ReservationsToPurchase $reservationsToPurchase -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse .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. -BODY : Calculate exchange request - [ReservationsToExchange ]: List of reservations that are being returned in this exchange. - [Quantity ]: Quantity to be returned. Must be greater than zero. - [ReservationId ]: Fully qualified identifier of the reservation being returned - [ReservationsToPurchase ]: List of reservations that are being purchased in this exchange. - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. - [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan - [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. - [Location ]: The Azure region where the reserved resource lives. - [Quantity ]: Quantity of the skus that are part of the reservation. - [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. - [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. - [Sku ]: - [Term ]: Represent the term of reservation. - [SavingsPlansToPurchase ]: List of savings plans that are being purchased in this exchange. - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [BillingPlan ]: Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. - [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan - [CommitmentAmount ]: - [CommitmentCurrencyCode ]: The ISO 4217 3-letter currency code for the currency used by this purchase record. - [CommitmentGrain ]: Commitment grain. - [DisplayName ]: Friendly name of the savings plan - [SkuName ]: - [Term ]: Represent savings plan term in ISO 8601 format. - RESERVATIONSTOEXCHANGE : List of reservations that are being returned in this exchange. [Quantity ]: Quantity to be returned. Must be greater than zero. [ReservationId ]: Fully qualified identifier of the reservation being returned @@ -1786,19 +1855,19 @@ RESERVATIONSTOPURCHASE : List of reservations that are being [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. + [AppliedScopeType ]: Type of the Applied Scope. + [AppliedScopes >]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. + [BillingPlan ]: Represent the billing plans. [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. + [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. [Location ]: The Azure region where the reserved resource lives. [Quantity ]: Quantity of the skus that are part of the reservation. [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. + [ReservedResourceType ]: The type of the resource that is being reserved. [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. [Sku ]: - [Term ]: Represent the term of reservation. + [Term ]: Represent the term of reservation. SAVINGSPLANSTOPURCHASE : List of savings plans that are being purchased in this exchange. [AppliedScopePropertyDisplayName ]: Display name @@ -1806,53 +1875,55 @@ SAVINGSPLANSTOPURCHASE : List of savings plans th [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [BillingPlan ]: Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. + [AppliedScopeType ]: Type of the Applied Scope. + [BillingPlan ]: Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan [CommitmentAmount ]: [CommitmentCurrencyCode ]: The ISO 4217 3-letter currency code for the currency used by this purchase record. - [CommitmentGrain ]: Commitment grain. + [CommitmentGrain ]: Commitment grain. [DisplayName ]: Friendly name of the savings plan [SkuName ]: - [Term ]: Represent savings plan term in ISO 8601 format. + [Term ]: Represent savings plan term in ISO 8601 format. .Link https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationcalculateexchange #> function Invoke-AzReservationCalculateExchange { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse])] [CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Post', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest] - # Calculate exchange request - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='PostExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[]] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn[]] # List of reservations that are being returned in this exchange. - # To construct, see NOTES section for RESERVATIONSTOEXCHANGE properties and create a hash table. ${ReservationsToExchange}, [Parameter(ParameterSetName='PostExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[]] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest[]] # List of reservations that are being purchased in this exchange. - # To construct, see NOTES section for RESERVATIONSTOPURCHASE properties and create a hash table. ${ReservationsToPurchase}, [Parameter(ParameterSetName='PostExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[]] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest[]] # List of savings plans that are being purchased in this exchange. - # To construct, see NOTES section for SAVINGSPLANSTOPURCHASE properties and create a hash table. ${SavingsPlansToPurchase}, + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Post operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Post operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1921,6 +1992,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1940,8 +2020,9 @@ begin { } $mapping = @{ - Post = 'Az.Reservations.private\Invoke-AzReservationCalculateExchange_Post'; PostExpanded = 'Az.Reservations.private\Invoke-AzReservationCalculateExchange_PostExpanded'; + PostViaJsonFilePath = 'Az.Reservations.private\Invoke-AzReservationCalculateExchange_PostViaJsonFilePath'; + PostViaJsonString = 'Az.Reservations.private\Invoke-AzReservationCalculateExchange_PostViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -1950,6 +2031,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2005,23 +2089,15 @@ $fullyQualifiedOrderId = "/providers/microsoft.capacity/reservationOrders/500000 Invoke-AzReservationCalculateRefund -ReservationOrderId $orderId -ReservationToReturnQuantity 1 -ReservationToReturnReservationId $fullyQualifiedId -Id $fullyQualifiedOrderId -Scope "Reservation" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse .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. -BODY : Request containing information needed for calculating refund. - [Id ]: Fully qualified identifier of the reservation order being returned - [ReservationToReturnQuantity ]: Quantity to be returned. Must be greater than zero. - [ReservationToReturnReservationId ]: Fully qualified identifier of the reservation being returned - [Scope ]: The scope of the refund, e.g. Reservation - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -2031,32 +2107,23 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationcalculaterefund #> function Invoke-AzReservationCalculateRefund { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse])] [CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Post', Mandatory)] [Parameter(ParameterSetName='PostExpanded', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${ReservationOrderId}, - [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Post', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest] - # Request containing information needed for calculating refund. - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='PostExpanded')] [Parameter(ParameterSetName='PostViaIdentityExpanded')] [Alias('ReservationId')] @@ -2088,6 +2155,18 @@ param( # Reservation ${Scope}, + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Post operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Post operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2144,6 +2223,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2163,10 +2251,10 @@ begin { } $mapping = @{ - Post = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_Post'; PostExpanded = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_PostExpanded'; - PostViaIdentity = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_PostViaIdentity'; PostViaIdentityExpanded = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_PostViaIdentityExpanded'; + PostViaJsonFilePath = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_PostViaJsonFilePath'; + PostViaJsonString = 'Az.Reservations.private\Invoke-AzReservationCalculateRefund_PostViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2175,6 +2263,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2226,37 +2317,33 @@ Returns one or more `Reservations` in exchange for one or more `Reservation` pur .Example Invoke-AzReservationExchange -SessionId 8982593c-679e-4d4e-b971-c48b6d824cba -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse -.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. - -BODY : Exchange request - [SessionId ]: SessionId that was returned by CalculateExchange API. +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationexchange #> function Invoke-AzReservationExchange { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse])] [CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Post', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest] - # Exchange request - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='PostExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # SessionId that was returned by CalculateExchange API. ${SessionId}, + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Post operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Post operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2325,6 +2412,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2344,8 +2440,9 @@ begin { } $mapping = @{ - Post = 'Az.Reservations.private\Invoke-AzReservationExchange_Post'; PostExpanded = 'Az.Reservations.private\Invoke-AzReservationExchange_PostExpanded'; + PostViaJsonFilePath = 'Az.Reservations.private\Invoke-AzReservationExchange_PostViaJsonFilePath'; + PostViaJsonString = 'Az.Reservations.private\Invoke-AzReservationExchange_PostViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2354,6 +2451,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2419,6 +2519,12 @@ INPUTOBJECT : Identity Parameter [ReservationId ]: Id of the reservation item [ReservationOrderId ]: Order Id of the reservation [SubscriptionId ]: Id of the subscription + +RESERVATIONORDERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [ReservationId ]: Id of the reservation item + [ReservationOrderId ]: Order Id of the reservation + [SubscriptionId ]: Id of the subscription .Link https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationunarchivereservation #> @@ -2427,6 +2533,7 @@ function Invoke-AzReservationUnarchiveReservation { [CmdletBinding(DefaultParameterSetName='Unarchive', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Unarchive', Mandatory)] + [Parameter(ParameterSetName='UnarchiveViaIdentityReservationOrder', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Id of the reservation item @@ -2442,9 +2549,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UnarchiveViaIdentityReservationOrder', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] + # Identity Parameter + ${ReservationOrderInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2507,6 +2619,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2528,6 +2649,7 @@ begin { $mapping = @{ Unarchive = 'Az.Reservations.private\Invoke-AzReservationUnarchiveReservation_Unarchive'; UnarchiveViaIdentity = 'Az.Reservations.private\Invoke-AzReservationUnarchiveReservation_UnarchiveViaIdentity'; + UnarchiveViaIdentityReservationOrder = 'Az.Reservations.private\Invoke-AzReservationUnarchiveReservation_UnarchiveViaIdentityReservationOrder'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2536,6 +2658,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2587,20 +2712,15 @@ Change directory (tenant) of `ReservationOrder` and all `Reservation` under it t .Example Move-AzReservationDirectory -ReservationOrderId "7c31a9e8-8490-4002-88cd-3a16b71362a9" -DestinationTenantId "f65fbe9a-14b0-44c6-8c0d-2ef2c4543040" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse .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. -BODY : Request body for change directory of a reservation. - [DestinationTenantId ]: Tenant id GUID that reservation order is to be transferred to - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -2610,32 +2730,23 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/move-azreservationdirectory #> function Move-AzReservationDirectory { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse])] [CmdletBinding(DefaultParameterSetName='ChangeExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Change', Mandatory)] [Parameter(ParameterSetName='ChangeExpanded', Mandatory)] + [Parameter(ParameterSetName='ChangeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ChangeViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${ReservationOrderId}, - [Parameter(ParameterSetName='ChangeViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='ChangeViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Change', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='ChangeViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest] - # Request body for change directory of a reservation. - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='ChangeExpanded')] [Parameter(ParameterSetName='ChangeViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] @@ -2643,6 +2754,18 @@ param( # Tenant id GUID that reservation order is to be transferred to ${DestinationTenantId}, + [Parameter(ParameterSetName='ChangeViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Change operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='ChangeViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Change operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2699,6 +2822,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -2718,10 +2850,10 @@ begin { } $mapping = @{ - Change = 'Az.Reservations.private\Move-AzReservationDirectory_Change'; ChangeExpanded = 'Az.Reservations.private\Move-AzReservationDirectory_ChangeExpanded'; - ChangeViaIdentity = 'Az.Reservations.private\Move-AzReservationDirectory_ChangeViaIdentity'; ChangeViaIdentityExpanded = 'Az.Reservations.private\Move-AzReservationDirectory_ChangeViaIdentityExpanded'; + ChangeViaJsonFilePath = 'Az.Reservations.private\Move-AzReservationDirectory_ChangeViaJsonFilePath'; + ChangeViaJsonString = 'Az.Reservations.private\Move-AzReservationDirectory_ChangeViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -2730,6 +2862,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -2775,43 +2910,21 @@ end { <# .Synopsis -Purchase `ReservationOrder` and create resource under the specified URI. +Purchase `ReservationOrder` and purchase resource under the specified URI. .Description -Purchase `ReservationOrder` and create resource under the specified URI. +Purchase `ReservationOrder` and purchase resource under the specified URI. .Example New-AzReservation -AppliedScopeType 'Shared' -BillingPlan 'Upfront' -billingScopeId '/subscriptions/b0f278e1-1f18-4378-84d7-b44dfa708665' -DisplayName 'TestVm2222' -Location 'westus' -Quantity 1 -ReservedResourceType 'VirtualMachines' -Sku 'Standard_b1ls' -Term 'P1Y' -ReservationOrderId '846655fa-d9e7-4fb8-9512-3ab7367352f1' -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse .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. -BODY : The request for reservation purchase - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. - [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan - [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. - [Location ]: The Azure region where the reserved resource lives. - [Quantity ]: Quantity of the skus that are part of the reservation. - [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. - [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. - [Sku ]: - [Term ]: Represent the term of reservation. - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -2821,32 +2934,23 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/new-azreservation #> function New-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse])] [CmdletBinding(DefaultParameterSetName='PurchaseExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Purchase', Mandatory)] [Parameter(ParameterSetName='PurchaseExpanded', Mandatory)] + [Parameter(ParameterSetName='PurchaseViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PurchaseViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${ReservationOrderId}, - [Parameter(ParameterSetName='PurchaseViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Purchase', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='PurchaseViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest] - # The request for reservation purchase - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] [AllowEmptyCollection()] @@ -2894,17 +2998,17 @@ param( [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType] + [System.String] # Type of the Applied Scope. ${AppliedScopeType}, [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan] + [System.String] # Represent the billing plans. ${BillingPlan}, @@ -2924,9 +3028,9 @@ param( [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility] + [System.String] # Turning this on will apply the reservation discount to other VMs in the same VM size group. # Only specify for VirtualMachines reserved resource type. ${InstanceFlexibility}, @@ -2954,9 +3058,9 @@ param( [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType] + [System.String] # The type of the resource that is being reserved. ${ReservedResourceType}, @@ -2976,12 +3080,24 @@ param( [Parameter(ParameterSetName='PurchaseExpanded')] [Parameter(ParameterSetName='PurchaseViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm])] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm] + [System.String] # Represent the term of reservation. ${Term}, + [Parameter(ParameterSetName='PurchaseViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Purchase operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PurchaseViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Purchase operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3050,6 +3166,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3069,10 +3194,10 @@ begin { } $mapping = @{ - Purchase = 'Az.Reservations.private\New-AzReservation_Purchase'; PurchaseExpanded = 'Az.Reservations.private\New-AzReservation_PurchaseExpanded'; - PurchaseViaIdentity = 'Az.Reservations.private\New-AzReservation_PurchaseViaIdentity'; PurchaseViaIdentityExpanded = 'Az.Reservations.private\New-AzReservation_PurchaseViaIdentityExpanded'; + PurchaseViaJsonFilePath = 'Az.Reservations.private\New-AzReservation_PurchaseViaJsonFilePath'; + PurchaseViaJsonString = 'Az.Reservations.private\New-AzReservation_PurchaseViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -3081,6 +3206,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3126,9 +3254,9 @@ end { <# .Synopsis -Updates the applied scopes of the `Reservation`. +update the applied scopes of the `Reservation`. .Description -Updates the applied scopes of the `Reservation`. +update the applied scopes of the `Reservation`. .Example Update-AzReservation -ReservationOrderId "30000000-aaaa-bbbb-cccc-200000000013" -ReservationId "10000000-aaaa-bbbb-cccc-200000000007" -Name "testName" .Example @@ -3141,12 +3269,10 @@ Update-AzReservation -ReservationOrderId "30000000-aaaa-bbbb-cccc-200000000013" # Single scope with resource group: Update-AzReservation -ReservationOrderId "30000000-aaaa-bbbb-cccc-200000000013" -ReservationId "10000000-aaaa-bbbb-cccc-200000000007" -AppliedScopeType "Single" -AppliedScope "/subscriptions/30000000-aaaa-bbbb-cccc-200000000018/resourcegroups/{your resource group name}" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -3165,93 +3291,66 @@ RENEWPROPERTY : . [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. + [AppliedScopeType ]: Type of the Applied Scope. + [AppliedScopes >]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. + [BillingPlan ]: Represent the billing plans. [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. + [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. [Location ]: The Azure region where the reserved resource lives. [Quantity ]: Quantity of the skus that are part of the reservation. [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. + [ReservedResourceType ]: The type of the resource that is being reserved. [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. [Sku ]: - [Term ]: Represent the term of reservation. + [Term ]: Represent the term of reservation. -RESERVATION : The request for reservation patch - [AppliedScope ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. - [Name ]: Display name of the reservation - [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [RenewProperty ]: - [PurchaseProperty ]: The request for reservation purchase - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. - [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan - [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. - [Location ]: The Azure region where the reserved resource lives. - [Quantity ]: Quantity of the skus that are part of the reservation. - [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. - [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. - [Sku ]: - [Term ]: Represent the term of reservation. - [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. +RESERVATIONORDERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [ReservationId ]: Id of the reservation item + [ReservationOrderId ]: Order Id of the reservation + [SubscriptionId ]: Id of the subscription .Link https://learn.microsoft.com/powershell/module/az.reservations/update-azreservation #> function Update-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ReservationId')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Id of the reservation item ${Id}, - [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ReservationOrderId')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${OrderId}, - [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch] - # The request for reservation patch - # To construct, see NOTES section for RESERVATION properties and create a hash table. - ${Reservation}, + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] + # Identity Parameter + ${ReservationOrderInputObject}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String[]] @@ -3262,6 +3361,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Display name @@ -3269,6 +3369,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Fully-qualified identifier of the management group where the benefit must be applied. @@ -3276,6 +3377,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Fully-qualified identifier of the resource group. @@ -3283,6 +3385,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Fully-qualified identifier of the subscription. @@ -3290,6 +3393,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Tenant ID where the savings plan should apply benefit. @@ -3297,23 +3401,26 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType])] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType] + [System.String] # Type of the Applied Scope. ${AppliedScopeType}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility])] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility] + [System.String] # Turning this on will apply the reservation discount to other VMs in the same VM size group. # Only specify for VirtualMachines reserved resource type. ${InstanceFlexibility}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Display name of the reservation @@ -3321,6 +3428,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.Management.Automation.SwitchParameter] # Setting this to true will automatically purchase a new reservation on the expiration date time. @@ -3328,19 +3436,32 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties] # . - # To construct, see NOTES section for RENEWPROPERTY properties and create a hash table. ${RenewProperty}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.DateTime] # This is the date-time when the Azure hybrid benefit needs to be reviewed. ${ReviewDateTime}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3409,6 +3530,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3428,10 +3558,11 @@ begin { } $mapping = @{ - Update = 'Az.Reservations.private\Update-AzReservation_Update'; UpdateExpanded = 'Az.Reservations.private\Update-AzReservation_UpdateExpanded'; - UpdateViaIdentity = 'Az.Reservations.private\Update-AzReservation_UpdateViaIdentity'; UpdateViaIdentityExpanded = 'Az.Reservations.private\Update-AzReservation_UpdateViaIdentityExpanded'; + UpdateViaIdentityReservationOrderExpanded = 'Az.Reservations.private\Update-AzReservation_UpdateViaIdentityReservationOrderExpanded'; + UpdateViaJsonFilePath = 'Az.Reservations.private\Update-AzReservation_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Reservations.private\Update-AzReservation_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -3440,6 +3571,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3485,9 +3619,9 @@ end { <# .Synopsis -Return a Reservation. +Return a reservation and get refund information. .Description -Return a Reservation. +Return a reservation and get refund information. .Example $orderId = "50000000-aaaa-bbbb-cccc-100000000003" $fullyQualifiedId = "/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000003/reservations/30000000-aaaa-bbbb-cccc-100000000003" @@ -3498,19 +3632,12 @@ Invoke-AzReservationCalculateRefund -ReservationOrderId $orderId -ReservationToR .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse .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. -BODY : The return request body. - [ReservationToReturnQuantity ]: Quantity to be returned. Must be greater than zero. - [ReservationToReturnReservationId ]: Fully qualified identifier of the reservation being returned - [ReturnReason ]: The reason of returning the reservation - [Scope ]: The scope of the refund, e.g. Reservation - [SessionId ]: SessionId that was returned by CalculateRefund API. - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -3520,48 +3647,48 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationreturn #> function Invoke-AzReservationReturn { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse])] [CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( + [Parameter(ParameterSetName='PostExpanded', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [System.String] + # Order Id of the reservation + ${ReservationOrderId}, + [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='PostExpanded', Mandatory)] - [Parameter(ParameterSetName='Post', Mandatory)] + [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [System.String] - # Reservation Order Id. - ${ReservationOrderId}, + [System.Int32] + # Quantity to be returned. + # Must be greater than zero. + ${ReservationToReturnQuantity}, [Parameter(ParameterSetName='PostExpanded', Mandatory)] [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] - # Reservation Id to return. + # Fully qualified identifier of the reservation being returned ${ReservationToReturnReservationId}, - [Parameter(ParameterSetName='PostExpanded', Mandatory)] - [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory)] - [ValidateNotNull()] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [System.Int32] - # Quantity to return. - ${ReservationToReturnQuantity}, - [Parameter(ParameterSetName='PostExpanded', Mandatory)] [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] - # The session id obtained from Invoke-AzReservationCalculateRefund.. - ${SessionId}, + # The reason of returning the reservation + ${ReturnReason}, [Parameter(ParameterSetName='PostExpanded', Mandatory)] [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory)] @@ -3577,24 +3704,28 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] - # The reason for this reservation return. - ${ReturnReason}, + # The session id obtained from Invoke-AzReservationCalculateRefund.. + ${SessionId}, - [Parameter(ParameterSetName='Post', Mandatory)] - [Parameter(ParameterSetName='PostViaIdentity', Mandatory)] - [ValidateNotNull()] + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Post operation + ${JsonString}, + + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest] - # The return request body. - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, + [System.String] + # Path of Json file supplied to the Post operation + ${JsonFilePath}, [Parameter(DontShow)] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -3644,6 +3775,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3664,9 +3804,9 @@ begin { $mapping = @{ PostExpanded = 'Az.Reservations.custom\Invoke-AzReservationReturn'; - Post = 'Az.Reservations.custom\Invoke-AzReservationReturn'; + PostViaJsonString = 'Az.Reservations.custom\Invoke-AzReservationReturn'; + PostViaJsonFilePath = 'Az.Reservations.custom\Invoke-AzReservationReturn'; PostViaIdentityExpanded = 'Az.Reservations.custom\Invoke-AzReservationReturn'; - PostViaIdentity = 'Az.Reservations.custom\Invoke-AzReservationReturn'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -3675,6 +3815,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3728,12 +3871,12 @@ $arr=@("72bc398d-b201-4a2e-a1fa-60fb48a85b23", "34f2474f-b4d7-41ec-a96d-d4bb7c2f Merge-AzReservation -ReservationOrderId "79ebddac-4030-4296-ab93-1ad90f032058" -ReservationId $arr .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/merge-azreservation #> function Merge-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -3806,6 +3949,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -3834,6 +3986,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -3887,12 +4042,12 @@ Split-AzReservation -ReservationOrderId "c615c897-aaaa-4123-8527-c42cc0da41e0" - .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/split-azreservation #> function Split-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -3972,6 +4127,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -4000,6 +4164,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Split-AzReservation.ps1 b/generated/Reservations/Reservations.Autorest/exports/Split-AzReservation.ps1 index 55f0afd5fdf3..d5c52009971c 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Split-AzReservation.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Split-AzReservation.ps1 @@ -24,12 +24,12 @@ Split-AzReservation -ReservationOrderId "c615c897-aaaa-4123-8527-c42cc0da41e0" - .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/split-azreservation #> function Split-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -109,6 +109,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -137,6 +146,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/exports/Update-AzReservation.ps1 b/generated/Reservations/Reservations.Autorest/exports/Update-AzReservation.ps1 index 75ff8dd90255..e93341275f6b 100644 --- a/generated/Reservations/Reservations.Autorest/exports/Update-AzReservation.ps1 +++ b/generated/Reservations/Reservations.Autorest/exports/Update-AzReservation.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Updates the applied scopes of the `Reservation`. +update the applied scopes of the `Reservation`. .Description -Updates the applied scopes of the `Reservation`. +update the applied scopes of the `Reservation`. .Example Update-AzReservation -ReservationOrderId "30000000-aaaa-bbbb-cccc-200000000013" -ReservationId "10000000-aaaa-bbbb-cccc-200000000007" -Name "testName" .Example @@ -31,12 +31,10 @@ Update-AzReservation -ReservationOrderId "30000000-aaaa-bbbb-cccc-200000000013" # Single scope with resource group: Update-AzReservation -ReservationOrderId "30000000-aaaa-bbbb-cccc-200000000013" -ReservationId "10000000-aaaa-bbbb-cccc-200000000007" -AppliedScopeType "Single" -AppliedScope "/subscriptions/30000000-aaaa-bbbb-cccc-200000000018/resourcegroups/{your resource group name}" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -55,93 +53,66 @@ RENEWPROPERTY : . [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. + [AppliedScopeType ]: Type of the Applied Scope. + [AppliedScopes >]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. + [BillingPlan ]: Represent the billing plans. [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. + [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. [Location ]: The Azure region where the reserved resource lives. [Quantity ]: Quantity of the skus that are part of the reservation. [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. + [ReservedResourceType ]: The type of the resource that is being reserved. [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. [Sku ]: - [Term ]: Represent the term of reservation. - -RESERVATION : The request for reservation patch - [AppliedScope ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. - [Name ]: Display name of the reservation - [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [RenewProperty ]: - [PurchaseProperty ]: The request for reservation purchase - [AppliedScopePropertyDisplayName ]: Display name - [AppliedScopePropertyManagementGroupId ]: Fully-qualified identifier of the management group where the benefit must be applied. - [AppliedScopePropertyResourceGroupId ]: Fully-qualified identifier of the resource group. - [AppliedScopePropertySubscriptionId ]: Fully-qualified identifier of the subscription. - [AppliedScopePropertyTenantId ]: Tenant ID where the savings plan should apply benefit. - [AppliedScopeType ]: Type of the Applied Scope. - [AppliedScopes ]: List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. - [BillingPlan ]: Represent the billing plans. - [BillingScopeId ]: Subscription that will be charged for purchasing reservation or savings plan - [DisplayName ]: Friendly name of the reservation - [InstanceFlexibility ]: Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type. - [Location ]: The Azure region where the reserved resource lives. - [Quantity ]: Quantity of the skus that are part of the reservation. - [Renew ]: Setting this to true will automatically purchase a new reservation on the expiration date time. - [ReservedResourceType ]: The type of the resource that is being reserved. - [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. - [Sku ]: - [Term ]: Represent the term of reservation. - [ReviewDateTime ]: This is the date-time when the Azure hybrid benefit needs to be reviewed. + [Term ]: Represent the term of reservation. + +RESERVATIONORDERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [ReservationId ]: Id of the reservation item + [ReservationOrderId ]: Order Id of the reservation + [SubscriptionId ]: Id of the subscription .Link https://learn.microsoft.com/powershell/module/az.reservations/update-azreservation #> function Update-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ReservationId')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Id of the reservation item ${Id}, - [Parameter(ParameterSetName='Update', Mandatory)] [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ReservationOrderId')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${OrderId}, - [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Update', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='UpdateViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch] - # The request for reservation patch - # To construct, see NOTES section for RESERVATION properties and create a hash table. - ${Reservation}, + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] + # Identity Parameter + ${ReservationOrderInputObject}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String[]] @@ -152,6 +123,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Display name @@ -159,6 +131,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Fully-qualified identifier of the management group where the benefit must be applied. @@ -166,6 +139,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Fully-qualified identifier of the resource group. @@ -173,6 +147,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Fully-qualified identifier of the subscription. @@ -180,6 +155,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Tenant ID where the savings plan should apply benefit. @@ -187,23 +163,26 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType])] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType] + [System.String] # Type of the Applied Scope. ${AppliedScopeType}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility])] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility] + [System.String] # Turning this on will apply the reservation discount to other VMs in the same VM size group. # Only specify for VirtualMachines reserved resource type. ${InstanceFlexibility}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.String] # Display name of the reservation @@ -211,6 +190,7 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.Management.Automation.SwitchParameter] # Setting this to true will automatically purchase a new reservation on the expiration date time. @@ -218,19 +198,32 @@ param( [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties] # . - # To construct, see NOTES section for RENEWPROPERTY properties and create a hash table. ${RenewProperty}, [Parameter(ParameterSetName='UpdateExpanded')] [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityReservationOrderExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] [System.DateTime] # This is the date-time when the Azure hybrid benefit needs to be reviewed. ${ReviewDateTime}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -299,6 +292,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -318,10 +320,11 @@ begin { } $mapping = @{ - Update = 'Az.Reservations.private\Update-AzReservation_Update'; UpdateExpanded = 'Az.Reservations.private\Update-AzReservation_UpdateExpanded'; - UpdateViaIdentity = 'Az.Reservations.private\Update-AzReservation_UpdateViaIdentity'; UpdateViaIdentityExpanded = 'Az.Reservations.private\Update-AzReservation_UpdateViaIdentityExpanded'; + UpdateViaIdentityReservationOrderExpanded = 'Az.Reservations.private\Update-AzReservation_UpdateViaIdentityReservationOrderExpanded'; + UpdateViaJsonFilePath = 'Az.Reservations.private\Update-AzReservation_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.Reservations.private\Update-AzReservation_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) @@ -330,6 +333,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/generate-info.json b/generated/Reservations/Reservations.Autorest/generate-info.json index f01a6e5c92d1..edb7af219d23 100644 --- a/generated/Reservations/Reservations.Autorest/generate-info.json +++ b/generated/Reservations/Reservations.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "3ad71e82-d301-4a09-9eaa-da9ed9082998" + "generate_Id": "5e316ba2-1e49-4220-ad42-f59f4b1209ea" } diff --git a/generated/Reservations/Reservations.Autorest/generated/Module.cs b/generated/Reservations/Reservations.Autorest/generated/Module.cs index b3a3704918c8..5ac55ee29a78 100644 --- a/generated/Reservations/Reservations.Autorest/generated/Module.cs +++ b/generated/Reservations/Reservations.Autorest/generated/Module.cs @@ -28,12 +28,20 @@ public partial class Module public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + private static bool _init = false; + + private static readonly global::System.Object _initLock = new global::System.Object(); + + private static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,11 +64,8 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } } /// The Name of this module public string Name => @"Az.Reservations"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Crea /// Initialization steps performed after the module is loaded. public void Init() { - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); - CustomInit(); + if (_init == false) + { + lock (_initLock) { + if (_init == false) { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + _init = true; + } + } + } } /// Creates the module instance. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.PowerShell.cs index 3192c6cfa6f5..faf7408ca85e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -146,7 +146,7 @@ public override string ToString() return ToJsonString(); } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.cs index 5379d34034c5..e6fe9a72696c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.json.cs index a03bc10f368c..a39e9ea81f06 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.PowerShell.cs deleted file mode 100644 index d323dbf28247..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.PowerShell.cs +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// CalculateExchange operation result - [System.ComponentModel.TypeConverter(typeof(CalculateExchangeOperationResultResponseTypeConverter))] - public partial class CalculateExchangeOperationResultResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal CalculateExchangeOperationResultResponse(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Properties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeResponsePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultErrorTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus.CreateFrom); - } - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorsTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("NetPayable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("RefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasesTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ReservationsToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("SavingsPlansToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("ReservationsToExchange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("PolicyResultPolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PolicyResultPolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[]) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CalculateExchangeOperationResultResponse(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Properties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeResponsePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultErrorTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus.CreateFrom); - } - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorsTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("NetPayable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("RefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasesTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ReservationsToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("SavingsPlansToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("ReservationsToExchange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("PolicyResultPolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PolicyResultPolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[]) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorTypeConverter.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.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CalculateExchangeOperationResultResponse(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.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CalculateExchangeOperationResultResponse(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.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// CalculateExchange operation result - [System.ComponentModel.TypeConverter(typeof(CalculateExchangeOperationResultResponseTypeConverter))] - public partial interface ICalculateExchangeOperationResultResponse - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.PowerShell.cs deleted file mode 100644 index 71c65663362f..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.PowerShell.cs +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// CalculateExchange response properties - [System.ComponentModel.TypeConverter(typeof(CalculateExchangeResponsePropertiesTypeConverter))] - public partial class CalculateExchangeResponseProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal CalculateExchangeResponseProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorsTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("NetPayable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("RefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasesTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ReservationsToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("SavingsPlansToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("ReservationsToExchange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("PolicyResultPolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PolicyResultPolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[]) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CalculateExchangeResponseProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorsTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("NetPayable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("RefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasesTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ReservationsToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("SavingsPlansToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("ReservationsToExchange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("PolicyResultPolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PolicyResultPolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[]) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorTypeConverter.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.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CalculateExchangeResponseProperties(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.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CalculateExchangeResponseProperties(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.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// CalculateExchange response properties - [System.ComponentModel.TypeConverter(typeof(CalculateExchangeResponsePropertiesTypeConverter))] - public partial interface ICalculateExchangeResponseProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.PowerShell.cs deleted file mode 100644 index 126446723c57..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.PowerShell.cs +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// The response of calculate refund containing refund information of reservation - [System.ComponentModel.TypeConverter(typeof(CalculateRefundResponseTypeConverter))] - public partial class CalculateRefundResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal CalculateRefundResponse(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.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponsePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PricingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyResultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultPropertyTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("BillingInformationCompletedTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationTotalTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ConsumedRefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("MaxRefundLimit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyErrorTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CalculateRefundResponse(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.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponsePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PricingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyResultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultPropertyTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("BillingInformationCompletedTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationTotalTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ConsumedRefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("MaxRefundLimit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyErrorTypeConverter.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.Reservations.Models.Api20221101.ICalculateRefundResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CalculateRefundResponse(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.Reservations.Models.Api20221101.ICalculateRefundResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CalculateRefundResponse(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.Reservations.Models.Api20221101.ICalculateRefundResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The response of calculate refund containing refund information of reservation - [System.ComponentModel.TypeConverter(typeof(CalculateRefundResponseTypeConverter))] - public partial interface ICalculateRefundResponse - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.cs deleted file mode 100644 index 0cf18166b8f9..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; - - /// Error information - public partial class Error : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal - { - - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)Error1).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)Error1).Code = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo _error1; - - /// Extended error information including error code and error message - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedErrorInfo()); set => this._error1 = value; } - - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)Error1).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)Error1).Message = value ?? null; } - - /// Internal Acessors for Error1 - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal.Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedErrorInfo()); set { {_error1 = value;} } } - - /// Creates an new instance. - public Error() - { - - } - } - /// Error information - public partial interface IError : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable - { - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Error code describing the reason that service is not able to process the incoming request", - SerializedName = @"code", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? Code { get; set; } - - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; set; } - - } - /// Error information - internal partial interface IErrorInternal - - { - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? Code { get; set; } - /// Extended error information including error code and error message - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo Error1 { get; set; } - - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.PowerShell.cs deleted file mode 100644 index bc52379687a1..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.PowerShell.cs +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// Exchange operation result - [System.ComponentModel.TypeConverter(typeof(ExchangeOperationResultResponseTypeConverter))] - public partial class ExchangeOperationResultResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ExchangeOperationResultResponse(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.Reservations.Models.Api20221101.IExchangeOperationResultResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ExchangeOperationResultResponse(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ExchangeOperationResultResponse(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Properties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeResponsePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultErrorTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus.CreateFrom); - } - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorsTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("NetPayable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("RefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasesTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ReservationsToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("SavingsPlansToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("ReservationsToExchange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnForExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("PolicyResultPolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PolicyResultPolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[]) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ExchangeOperationResultResponse(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Properties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeResponsePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultErrorTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus.CreateFrom); - } - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorsTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("NetPayable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("RefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasesTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ReservationsToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("SavingsPlansToPurchase")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("ReservationsToExchange")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnForExchangeTypeConverter.ConvertFrom)); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("PolicyResultPolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PolicyResultPolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[]) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Exchange operation result - [System.ComponentModel.TypeConverter(typeof(ExchangeOperationResultResponseTypeConverter))] - public partial interface IExchangeOperationResultResponse - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.cs deleted file mode 100644 index 469120b7b7de..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; - - /// Extended error information including error code and error message - public partial class ExtendedErrorInfo : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? _code; - - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? Code { get => this._code; set => this._code = value; } - - /// Backing field for property. - private string _message; - - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public string Message { get => this._message; set => this._message = value; } - - /// Creates an new instance. - public ExtendedErrorInfo() - { - - } - } - /// Extended error information including error code and error message - public partial interface IExtendedErrorInfo : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable - { - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Error code describing the reason that service is not able to process the incoming request", - SerializedName = @"code", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? Code { get; set; } - - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; set; } - - } - /// Extended error information including error code and error message - internal partial interface IExtendedErrorInfoInternal - - { - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? Code { get; set; } - - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.PowerShell.cs deleted file mode 100644 index 986efcadec32..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.PowerShell.cs +++ /dev/null @@ -1,332 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// The request for reservation purchase - [System.ComponentModel.TypeConverter(typeof(PurchaseRequestTypeConverter))] - public partial class PurchaseRequest - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PurchaseRequest(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.Reservations.Models.Api20221101.IPurchaseRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PurchaseRequest(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.Reservations.Models.Api20221101.IPurchaseRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PurchaseRequest(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("InternalSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("Properties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Sku, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopes")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopes = (string[]) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceProperties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReservedResourceProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReservedResourceProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("InstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId, 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 PurchaseRequest(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("InternalSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("Properties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Sku, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopes")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopes = (string[]) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceProperties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReservedResourceProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReservedResourceProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("InstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId, 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The request for reservation purchase - [System.ComponentModel.TypeConverter(typeof(PurchaseRequestTypeConverter))] - public partial interface IPurchaseRequest - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.PowerShell.cs deleted file mode 100644 index 23cf424550ed..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.PowerShell.cs +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// Properties of reservation purchase request - [System.ComponentModel.TypeConverter(typeof(PurchaseRequestPropertiesTypeConverter))] - public partial class PurchaseRequestProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PurchaseRequestProperties(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.Reservations.Models.Api20221101.IPurchaseRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PurchaseRequestProperties(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.Reservations.Models.Api20221101.IPurchaseRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PurchaseRequestProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceProperties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourceProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourceProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("AppliedScopes")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopes = (string[]) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourcePropertyInstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourcePropertyInstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId, 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 PurchaseRequestProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceProperties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourceProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourceProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("AppliedScopes")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopes = (string[]) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourcePropertyInstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).ReservedResourcePropertyInstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId, 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Properties of reservation purchase request - [System.ComponentModel.TypeConverter(typeof(PurchaseRequestPropertiesTypeConverter))] - public partial interface IPurchaseRequestProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.cs deleted file mode 100644 index ea0d5466954a..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; - - /// error details - public partial class RefundPolicyError : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyErrorInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? _code; - - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? Code { get => this._code; set => this._code = value; } - - /// Backing field for property. - private string _message; - - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public string Message { get => this._message; set => this._message = value; } - - /// Creates an new instance. - public RefundPolicyError() - { - - } - } - /// error details - public partial interface IRefundPolicyError : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable - { - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Error code describing the reason that service is not able to process the incoming request", - SerializedName = @"code", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? Code { get; set; } - - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; set; } - - } - /// error details - internal partial interface IRefundPolicyErrorInternal - - { - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode? Code { get; set; } - - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.PowerShell.cs deleted file mode 100644 index 01b85fde086a..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.PowerShell.cs +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// The response of refund request containing refund information of reservation - [System.ComponentModel.TypeConverter(typeof(RefundResponseTypeConverter))] - public partial class RefundResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RefundResponse(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.Reservations.Models.Api20221101.IRefundResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RefundResponse(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.Reservations.Models.Api20221101.IRefundResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RefundResponse(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.Reservations.Models.Api20221101.IRefundResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponsePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PricingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyResultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultPropertyTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("BillingInformationCompletedTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationTotalTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ConsumedRefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("MaxRefundLimit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyErrorTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal RefundResponse(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.Reservations.Models.Api20221101.IRefundResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponsePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PricingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyResultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultPropertyTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("BillingInformationCompletedTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationTotalTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ConsumedRefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("MaxRefundLimit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyErrorTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The response of refund request containing refund information of reservation - [System.ComponentModel.TypeConverter(typeof(RefundResponseTypeConverter))] - public partial interface IRefundResponse - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.PowerShell.cs deleted file mode 100644 index cd2530c9edcd..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.PowerShell.cs +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// The refund properties of reservation - [System.ComponentModel.TypeConverter(typeof(RefundResponsePropertiesTypeConverter))] - public partial class RefundResponseProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RefundResponseProperties(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.Reservations.Models.Api20221101.IRefundResponseProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RefundResponseProperties(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.Reservations.Models.Api20221101.IRefundResponseProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RefundResponseProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PricingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyResultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultPropertyTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("BillingInformationCompletedTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationTotalTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ConsumedRefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("MaxRefundLimit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyErrorTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal RefundResponseProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PolicyResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("SessionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PricingRefundAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyResultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultPropertyTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("BillingInformationCompletedTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationTotalTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("ConsumedRefundsTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("MaxRefundLimit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PolicyError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyErrorTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The refund properties of reservation - [System.ComponentModel.TypeConverter(typeof(RefundResponsePropertiesTypeConverter))] - public partial interface IRefundResponseProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.PowerShell.cs deleted file mode 100644 index ea62f5c29e4b..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.PowerShell.cs +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// The renew properties for a reservation. - [System.ComponentModel.TypeConverter(typeof(RenewPropertiesResponseTypeConverter))] - public partial class RenewPropertiesResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RenewPropertiesResponse(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.Reservations.Models.Api20221101.IRenewPropertiesResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RenewPropertiesResponse(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.Reservations.Models.Api20221101.IRenewPropertiesResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RenewPropertiesResponse(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PurchaseProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchaseProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) content.GetValueForProperty("PurchaseProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchaseProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom); - } - if (content.Contains("PricingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponsePricingCurrencyTotalTypeConverter.ConvertFrom); - } - if (content.Contains("BillingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseBillingCurrencyTotalTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasePropertySku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertySku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("PurchasePropertySku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertySku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasePropertiesProperties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertiesProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties) content.GetValueForProperty("PurchasePropertiesProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertiesProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasePropertyLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertyLocation = (string) content.GetValueForProperty("PurchasePropertyLocation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertyLocation, global::System.Convert.ToString); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PricingCurrencyTotalCurrencyCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalCurrencyCode = (string) content.GetValueForProperty("PricingCurrencyTotalCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalCurrencyCode, global::System.Convert.ToString); - } - if (content.Contains("PricingCurrencyTotalAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalAmount = (float?) content.GetValueForProperty("PricingCurrencyTotalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalAmount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - if (content.Contains("BillingCurrencyTotalCurrencyCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalCurrencyCode = (string) content.GetValueForProperty("BillingCurrencyTotalCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalCurrencyCode, global::System.Convert.ToString); - } - if (content.Contains("BillingCurrencyTotalAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalAmount = (float?) content.GetValueForProperty("BillingCurrencyTotalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalAmount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourcePropertyInstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourcePropertyInstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyResourceGroupId, 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 RenewPropertiesResponse(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PurchaseProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchaseProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) content.GetValueForProperty("PurchaseProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchaseProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom); - } - if (content.Contains("PricingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponsePricingCurrencyTotalTypeConverter.ConvertFrom); - } - if (content.Contains("BillingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseBillingCurrencyTotalTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasePropertySku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertySku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("PurchasePropertySku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertySku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasePropertiesProperties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertiesProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties) content.GetValueForProperty("PurchasePropertiesProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertiesProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("PurchasePropertyLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertyLocation = (string) content.GetValueForProperty("PurchasePropertyLocation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PurchasePropertyLocation, global::System.Convert.ToString); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PricingCurrencyTotalCurrencyCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalCurrencyCode = (string) content.GetValueForProperty("PricingCurrencyTotalCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalCurrencyCode, global::System.Convert.ToString); - } - if (content.Contains("PricingCurrencyTotalAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalAmount = (float?) content.GetValueForProperty("PricingCurrencyTotalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalAmount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - if (content.Contains("BillingCurrencyTotalCurrencyCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalCurrencyCode = (string) content.GetValueForProperty("BillingCurrencyTotalCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalCurrencyCode, global::System.Convert.ToString); - } - if (content.Contains("BillingCurrencyTotalAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalAmount = (float?) content.GetValueForProperty("BillingCurrencyTotalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalAmount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourcePropertyInstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).ReservedResourcePropertyInstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal)this).AppliedScopePropertyResourceGroupId, 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The renew properties for a reservation. - [System.ComponentModel.TypeConverter(typeof(RenewPropertiesResponseTypeConverter))] - public partial interface IRenewPropertiesResponse - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.PowerShell.cs deleted file mode 100644 index 7f8b9fdd6e6c..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.PowerShell.cs +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// Properties of a reservation order. - [System.ComponentModel.TypeConverter(typeof(ReservationOrderPropertiesTypeConverter))] - public partial class ReservationOrderProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ReservationOrderProperties(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.Reservations.Models.Api20221101.IReservationOrderProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ReservationOrderProperties(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.Reservations.Models.Api20221101.IReservationOrderProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ReservationOrderProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PlanInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation) content.GetValueForProperty("PlanInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderBillingPlanInformationTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("RequestDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).RequestDateTime = (global::System.DateTime?) content.GetValueForProperty("RequestDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).RequestDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CreatedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("BenefitStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("OriginalQuantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).OriginalQuantity = (int?) content.GetValueForProperty("OriginalQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).OriginalQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Reservation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).Reservation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[]) content.GetValueForProperty("Reservation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).Reservation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponseTypeConverter.ConvertFrom)); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationPricingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationPricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PlanInformationPricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationPricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PlanInformationStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationStartDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationNextPaymentDueDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationNextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationNextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationNextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationTransaction = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[]) content.GetValueForProperty("PlanInformationTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationTransaction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetailTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ReservationOrderProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PlanInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation) content.GetValueForProperty("PlanInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderBillingPlanInformationTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("RequestDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).RequestDateTime = (global::System.DateTime?) content.GetValueForProperty("RequestDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).RequestDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CreatedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("BenefitStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("OriginalQuantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).OriginalQuantity = (int?) content.GetValueForProperty("OriginalQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).OriginalQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Reservation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).Reservation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[]) content.GetValueForProperty("Reservation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).Reservation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponseTypeConverter.ConvertFrom)); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationPricingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationPricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PlanInformationPricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationPricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PlanInformationStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationStartDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationNextPaymentDueDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationNextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationNextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationNextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationTransaction = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[]) content.GetValueForProperty("PlanInformationTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)this).PlanInformationTransaction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetailTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Properties of a reservation order. - [System.ComponentModel.TypeConverter(typeof(ReservationOrderPropertiesTypeConverter))] - public partial interface IReservationOrderProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.PowerShell.cs deleted file mode 100644 index 120a85ca56b1..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.PowerShell.cs +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// Details of a reservation order being returned. - [System.ComponentModel.TypeConverter(typeof(ReservationOrderResponseTypeConverter))] - public partial class ReservationOrderResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ReservationOrderResponse(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.Reservations.Models.Api20221101.IReservationOrderResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ReservationOrderResponse(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.Reservations.Models.Api20221101.IReservationOrderResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ReservationOrderResponse(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.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Etag = (int?) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Etag, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation) content.GetValueForProperty("PlanInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderBillingPlanInformationTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("RequestDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).RequestDateTime = (global::System.DateTime?) content.GetValueForProperty("RequestDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).RequestDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CreatedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("BenefitStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("OriginalQuantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).OriginalQuantity = (int?) content.GetValueForProperty("OriginalQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).OriginalQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Reservations")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Reservations = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[]) content.GetValueForProperty("Reservations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Reservations, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponseTypeConverter.ConvertFrom)); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationPricingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationPricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PlanInformationPricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationPricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PlanInformationStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationStartDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationNextPaymentDueDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationNextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationNextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationNextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationTransaction = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[]) content.GetValueForProperty("PlanInformationTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationTransaction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetailTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ReservationOrderResponse(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.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Etag = (int?) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Etag, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation) content.GetValueForProperty("PlanInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderBillingPlanInformationTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("RequestDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).RequestDateTime = (global::System.DateTime?) content.GetValueForProperty("RequestDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).RequestDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("CreatedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("BenefitStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("OriginalQuantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).OriginalQuantity = (int?) content.GetValueForProperty("OriginalQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).OriginalQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Reservations")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Reservations = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[]) content.GetValueForProperty("Reservations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).Reservations, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponseTypeConverter.ConvertFrom)); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationPricingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationPricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PlanInformationPricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationPricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PlanInformationStartDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationStartDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationNextPaymentDueDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationNextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationNextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationNextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PlanInformationTransaction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationTransaction = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[]) content.GetValueForProperty("PlanInformationTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal)this).PlanInformationTransaction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetailTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Details of a reservation order being returned. - [System.ComponentModel.TypeConverter(typeof(ReservationOrderResponseTypeConverter))] - public partial interface IReservationOrderResponse - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.PowerShell.cs deleted file mode 100644 index 88516ffce791..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.PowerShell.cs +++ /dev/null @@ -1,636 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// The definition of the reservation. - [System.ComponentModel.TypeConverter(typeof(ReservationResponseTypeConverter))] - public partial class ReservationResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ReservationResponse(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.Reservations.Models.Api20221101.IReservationResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ReservationResponse(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.Reservations.Models.Api20221101.IReservationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ReservationResponse(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("InternalSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Etag = (int?) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Etag, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("InstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("AppliedScopes")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopes = (string[]) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SwapProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties) content.GetValueForProperty("SwapProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSwapPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Utilization")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Utilization = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization) content.GetValueForProperty("Utilization",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Utilization, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesUtilizationTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("Archived")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Archived = (bool?) content.GetValueForProperty("Archived",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Archived, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Capability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Capability = (string) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Capability, global::System.Convert.ToString); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("EffectiveDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).EffectiveDateTime = (global::System.DateTime?) content.GetValueForProperty("EffectiveDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).EffectiveDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("BenefitStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastUpdatedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).LastUpdatedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastUpdatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).LastUpdatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SkuDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SkuDescription, global::System.Convert.ToString); - } - if (content.Contains("ExtendedStatusInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfoTypeConverter.ConvertFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("DisplayProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).DisplayProvisioningState = (string) content.GetValueForProperty("DisplayProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).DisplayProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningSubState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ProvisioningSubState = (string) content.GetValueForProperty("ProvisioningSubState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ProvisioningSubState, global::System.Convert.ToString); - } - if (content.Contains("PurchaseDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).PurchaseDate = (global::System.DateTime?) content.GetValueForProperty("PurchaseDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).PurchaseDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PurchaseDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).PurchaseDateTime = (global::System.DateTime?) content.GetValueForProperty("PurchaseDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).PurchaseDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SplitProperties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SplitProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties) content.GetValueForProperty("SplitProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SplitProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSplitPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("MergeProperties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).MergeProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties) content.GetValueForProperty("MergeProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).MergeProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationMergePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("RenewSource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewSource = (string) content.GetValueForProperty("RenewSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewSource, global::System.Convert.ToString); - } - if (content.Contains("RenewDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewDestination = (string) content.GetValueForProperty("RenewDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewDestination, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("UserFriendlyAppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UserFriendlyAppliedScopeType = (string) content.GetValueForProperty("UserFriendlyAppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UserFriendlyAppliedScopeType, global::System.Convert.ToString); - } - if (content.Contains("UserFriendlyRenewState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UserFriendlyRenewState = (string) content.GetValueForProperty("UserFriendlyRenewState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UserFriendlyRenewState, global::System.Convert.ToString); - } - if (content.Contains("RenewProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseTypeConverter.ConvertFrom); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("SwapPropertySwapSource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapPropertySwapSource = (string) content.GetValueForProperty("SwapPropertySwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapPropertySwapSource, global::System.Convert.ToString); - } - if (content.Contains("SwapPropertySwapDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapPropertySwapDestination = (string) content.GetValueForProperty("SwapPropertySwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapPropertySwapDestination, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); - } - if (content.Contains("UtilizationTrend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UtilizationTrend = (string) content.GetValueForProperty("UtilizationTrend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UtilizationTrend, global::System.Convert.ToString); - } - if (content.Contains("UtilizationAggregate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UtilizationAggregate = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[]) content.GetValueForProperty("UtilizationAggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UtilizationAggregate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationUtilizationAggregatesTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ReservationResponse(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("InternalSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Etag = (int?) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Etag, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind.CreateFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("InstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("AppliedScopes")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopes = (string[]) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SwapProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties) content.GetValueForProperty("SwapProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSwapPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Utilization")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Utilization = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization) content.GetValueForProperty("Utilization",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Utilization, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesUtilizationTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("Archived")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Archived = (bool?) content.GetValueForProperty("Archived",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Archived, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Capability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Capability = (string) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Capability, global::System.Convert.ToString); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("EffectiveDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).EffectiveDateTime = (global::System.DateTime?) content.GetValueForProperty("EffectiveDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).EffectiveDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("BenefitStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastUpdatedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).LastUpdatedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastUpdatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).LastUpdatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SkuDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SkuDescription, global::System.Convert.ToString); - } - if (content.Contains("ExtendedStatusInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfoTypeConverter.ConvertFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("DisplayProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).DisplayProvisioningState = (string) content.GetValueForProperty("DisplayProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).DisplayProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningSubState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ProvisioningSubState = (string) content.GetValueForProperty("ProvisioningSubState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).ProvisioningSubState, global::System.Convert.ToString); - } - if (content.Contains("PurchaseDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).PurchaseDate = (global::System.DateTime?) content.GetValueForProperty("PurchaseDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).PurchaseDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PurchaseDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).PurchaseDateTime = (global::System.DateTime?) content.GetValueForProperty("PurchaseDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).PurchaseDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SplitProperties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SplitProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties) content.GetValueForProperty("SplitProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SplitProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSplitPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("MergeProperties")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).MergeProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties) content.GetValueForProperty("MergeProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).MergeProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationMergePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("RenewSource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewSource = (string) content.GetValueForProperty("RenewSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewSource, global::System.Convert.ToString); - } - if (content.Contains("RenewDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewDestination = (string) content.GetValueForProperty("RenewDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewDestination, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("UserFriendlyAppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UserFriendlyAppliedScopeType = (string) content.GetValueForProperty("UserFriendlyAppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UserFriendlyAppliedScopeType, global::System.Convert.ToString); - } - if (content.Contains("UserFriendlyRenewState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UserFriendlyRenewState = (string) content.GetValueForProperty("UserFriendlyRenewState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UserFriendlyRenewState, global::System.Convert.ToString); - } - if (content.Contains("RenewProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseTypeConverter.ConvertFrom); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("SwapPropertySwapSource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapPropertySwapSource = (string) content.GetValueForProperty("SwapPropertySwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapPropertySwapSource, global::System.Convert.ToString); - } - if (content.Contains("SwapPropertySwapDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapPropertySwapDestination = (string) content.GetValueForProperty("SwapPropertySwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).SwapPropertySwapDestination, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); - } - if (content.Contains("UtilizationTrend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UtilizationTrend = (string) content.GetValueForProperty("UtilizationTrend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UtilizationTrend, global::System.Convert.ToString); - } - if (content.Contains("UtilizationAggregate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UtilizationAggregate = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[]) content.GetValueForProperty("UtilizationAggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal)this).UtilizationAggregate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationUtilizationAggregatesTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The definition of the reservation. - [System.ComponentModel.TypeConverter(typeof(ReservationResponseTypeConverter))] - public partial interface IReservationResponse - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.PowerShell.cs deleted file mode 100644 index e6c0010febb5..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.PowerShell.cs +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// Reservation purchase details - [System.ComponentModel.TypeConverter(typeof(ReservationToPurchaseCalculateExchangeTypeConverter))] - public partial class ReservationToPurchaseCalculateExchange - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ReservationToPurchaseCalculateExchange(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.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ReservationToPurchaseCalculateExchange(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.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ReservationToPurchaseCalculateExchange(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.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom); - } - if (content.Contains("BillingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PurchaseRequestProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).PurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties) content.GetValueForProperty("PurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).PurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("AppliedScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourcePropertyInstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourcePropertyInstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId, 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 ReservationToPurchaseCalculateExchange(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.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom); - } - if (content.Contains("BillingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("PurchaseRequestProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).PurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties) content.GetValueForProperty("PurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).PurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("AppliedScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourcePropertyInstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourcePropertyInstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId, 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Reservation purchase details - [System.ComponentModel.TypeConverter(typeof(ReservationToPurchaseCalculateExchangeTypeConverter))] - public partial interface IReservationToPurchaseCalculateExchange - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.PowerShell.cs deleted file mode 100644 index 6695fd4d29ad..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.PowerShell.cs +++ /dev/null @@ -1,510 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// The properties of the reservations - [System.ComponentModel.TypeConverter(typeof(ReservationsPropertiesTypeConverter))] - public partial class ReservationsProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ReservationsProperties(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.Reservations.Models.Api20221101.IReservationsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ReservationsProperties(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.Reservations.Models.Api20221101.IReservationsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ReservationsProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SwapProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties) content.GetValueForProperty("SwapProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSwapPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Utilization")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Utilization = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization) content.GetValueForProperty("Utilization",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Utilization, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesUtilizationTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("InstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("Archived")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Archived = (bool?) content.GetValueForProperty("Archived",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Archived, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Capability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Capability = (string) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Capability, global::System.Convert.ToString); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("EffectiveDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).EffectiveDateTime = (global::System.DateTime?) content.GetValueForProperty("EffectiveDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).EffectiveDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("BenefitStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastUpdatedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).LastUpdatedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastUpdatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).LastUpdatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SkuDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SkuDescription, global::System.Convert.ToString); - } - if (content.Contains("ExtendedStatusInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfoTypeConverter.ConvertFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("DisplayProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).DisplayProvisioningState = (string) content.GetValueForProperty("DisplayProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).DisplayProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningSubState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ProvisioningSubState = (string) content.GetValueForProperty("ProvisioningSubState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ProvisioningSubState, global::System.Convert.ToString); - } - if (content.Contains("PurchaseDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).PurchaseDate = (global::System.DateTime?) content.GetValueForProperty("PurchaseDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).PurchaseDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PurchaseDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).PurchaseDateTime = (global::System.DateTime?) content.GetValueForProperty("PurchaseDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).PurchaseDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SplitProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SplitProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties) content.GetValueForProperty("SplitProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SplitProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSplitPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("MergeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).MergeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties) content.GetValueForProperty("MergeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).MergeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationMergePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RenewSource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewSource = (string) content.GetValueForProperty("RenewSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewSource, global::System.Convert.ToString); - } - if (content.Contains("RenewDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewDestination = (string) content.GetValueForProperty("RenewDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewDestination, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("UserFriendlyAppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UserFriendlyAppliedScopeType = (string) content.GetValueForProperty("UserFriendlyAppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UserFriendlyAppliedScopeType, global::System.Convert.ToString); - } - if (content.Contains("UserFriendlyRenewState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UserFriendlyRenewState = (string) content.GetValueForProperty("UserFriendlyRenewState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UserFriendlyRenewState, global::System.Convert.ToString); - } - if (content.Contains("RenewProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseTypeConverter.ConvertFrom); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("SwapPropertySwapSource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapPropertySwapSource = (string) content.GetValueForProperty("SwapPropertySwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapPropertySwapSource, global::System.Convert.ToString); - } - if (content.Contains("SwapPropertySwapDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapPropertySwapDestination = (string) content.GetValueForProperty("SwapPropertySwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapPropertySwapDestination, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); - } - if (content.Contains("UtilizationTrend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UtilizationTrend = (string) content.GetValueForProperty("UtilizationTrend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UtilizationTrend, global::System.Convert.ToString); - } - if (content.Contains("UtilizationAggregate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UtilizationAggregate = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[]) content.GetValueForProperty("UtilizationAggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UtilizationAggregate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationUtilizationAggregatesTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ReservationsProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SwapProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties) content.GetValueForProperty("SwapProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSwapPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Utilization")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Utilization = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization) content.GetValueForProperty("Utilization",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Utilization, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesUtilizationTypeConverter.ConvertFrom); - } - if (content.Contains("ReservedResourceType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ReservedResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType?) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ReservedResourceType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType.CreateFrom); - } - if (content.Contains("InstanceFlexibility")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("Archived")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Archived = (bool?) content.GetValueForProperty("Archived",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Archived, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Capability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Capability = (string) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Capability, global::System.Convert.ToString); - } - if (content.Contains("Quantity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState.CreateFrom); - } - if (content.Contains("EffectiveDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).EffectiveDateTime = (global::System.DateTime?) content.GetValueForProperty("EffectiveDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).EffectiveDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("BenefitStartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastUpdatedDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).LastUpdatedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastUpdatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).LastUpdatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ExpiryDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ReviewDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SkuDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SkuDescription, global::System.Convert.ToString); - } - if (content.Contains("ExtendedStatusInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfoTypeConverter.ConvertFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); - } - if (content.Contains("DisplayProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).DisplayProvisioningState = (string) content.GetValueForProperty("DisplayProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).DisplayProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningSubState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ProvisioningSubState = (string) content.GetValueForProperty("ProvisioningSubState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).ProvisioningSubState, global::System.Convert.ToString); - } - if (content.Contains("PurchaseDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).PurchaseDate = (global::System.DateTime?) content.GetValueForProperty("PurchaseDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).PurchaseDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PurchaseDateTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).PurchaseDateTime = (global::System.DateTime?) content.GetValueForProperty("PurchaseDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).PurchaseDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SplitProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SplitProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties) content.GetValueForProperty("SplitProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SplitProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSplitPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("MergeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).MergeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties) content.GetValueForProperty("MergeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).MergeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationMergePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Renew")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("RenewSource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewSource = (string) content.GetValueForProperty("RenewSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewSource, global::System.Convert.ToString); - } - if (content.Contains("RenewDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewDestination = (string) content.GetValueForProperty("RenewDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewDestination, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom); - } - if (content.Contains("UserFriendlyAppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UserFriendlyAppliedScopeType = (string) content.GetValueForProperty("UserFriendlyAppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UserFriendlyAppliedScopeType, global::System.Convert.ToString); - } - if (content.Contains("UserFriendlyRenewState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UserFriendlyRenewState = (string) content.GetValueForProperty("UserFriendlyRenewState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UserFriendlyRenewState, global::System.Convert.ToString); - } - if (content.Contains("RenewProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseTypeConverter.ConvertFrom); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("SwapPropertySwapSource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapPropertySwapSource = (string) content.GetValueForProperty("SwapPropertySwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapPropertySwapSource, global::System.Convert.ToString); - } - if (content.Contains("SwapPropertySwapDestination")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapPropertySwapDestination = (string) content.GetValueForProperty("SwapPropertySwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).SwapPropertySwapDestination, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); - } - if (content.Contains("UtilizationTrend")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UtilizationTrend = (string) content.GetValueForProperty("UtilizationTrend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UtilizationTrend, global::System.Convert.ToString); - } - if (content.Contains("UtilizationAggregate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UtilizationAggregate = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[]) content.GetValueForProperty("UtilizationAggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)this).UtilizationAggregate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationUtilizationAggregatesTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The properties of the reservations - [System.ComponentModel.TypeConverter(typeof(ReservationsPropertiesTypeConverter))] - public partial interface IReservationsProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.PowerShell.cs deleted file mode 100644 index fc30c369f2a4..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.PowerShell.cs +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// Properties of a savings plan purchase - [System.ComponentModel.TypeConverter(typeof(SavingsPlanPurchaseRequestPropertiesTypeConverter))] - public partial class SavingsPlanPurchaseRequestProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new SavingsPlanPurchaseRequestProperties(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.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new SavingsPlanPurchaseRequestProperties(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.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal SavingsPlanPurchaseRequestProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Commitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CommitmentTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan.CreateFrom); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("CommitmentGrain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentGrain = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain?) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentGrain, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); - } - if (content.Contains("CommitmentCurrencyCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); - } - if (content.Contains("CommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal SavingsPlanPurchaseRequestProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Commitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CommitmentTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm.CreateFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan.CreateFrom); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("CommitmentGrain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentGrain = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain?) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentGrain, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); - } - if (content.Contains("CommitmentCurrencyCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); - } - if (content.Contains("CommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); - } - 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Properties of a savings plan purchase - [System.ComponentModel.TypeConverter(typeof(SavingsPlanPurchaseRequestPropertiesTypeConverter))] - public partial interface ISavingsPlanPurchaseRequestProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.PowerShell.cs deleted file mode 100644 index ba55f60399e2..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.PowerShell.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// Savings plan purchase details - [System.ComponentModel.TypeConverter(typeof(SavingsPlanToPurchaseCalculateExchangeTypeConverter))] - public partial class SavingsPlanToPurchaseCalculateExchange - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new SavingsPlanToPurchaseCalculateExchange(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.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new SavingsPlanToPurchaseCalculateExchange(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.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal SavingsPlanToPurchaseCalculateExchange(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.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom); - } - if (content.Contains("BillingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("SavingsPlanPurchaseRequestProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SavingsPlanPurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("SavingsPlanPurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SavingsPlanPurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Commitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CommitmentTypeConverter.ConvertFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan.CreateFrom); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm.CreateFrom); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("CommitmentGrain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentGrain = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain?) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentGrain, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); - } - if (content.Contains("CommitmentCurrencyCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); - } - if (content.Contains("CommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal SavingsPlanToPurchaseCalculateExchange(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.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom); - } - if (content.Contains("BillingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("SavingsPlanPurchaseRequestProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SavingsPlanPurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("SavingsPlanPurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SavingsPlanPurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Commitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CommitmentTypeConverter.ConvertFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan.CreateFrom); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm.CreateFrom); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("CommitmentGrain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentGrain = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain?) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentGrain, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); - } - if (content.Contains("CommitmentCurrencyCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); - } - if (content.Contains("CommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); - } - 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Savings plan purchase details - [System.ComponentModel.TypeConverter(typeof(SavingsPlanToPurchaseCalculateExchangeTypeConverter))] - public partial interface ISavingsPlanToPurchaseCalculateExchange - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.PowerShell.cs deleted file mode 100644 index 46227e81abaf..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.PowerShell.cs +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - - /// Savings plan purchase details - [System.ComponentModel.TypeConverter(typeof(SavingsPlanToPurchaseExchangeTypeConverter))] - public partial class SavingsPlanToPurchaseExchange - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new SavingsPlanToPurchaseExchange(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.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new SavingsPlanToPurchaseExchange(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.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal SavingsPlanToPurchaseExchange(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.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom); - } - if (content.Contains("SavingsPlanOrderId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanOrderId = (string) content.GetValueForProperty("SavingsPlanOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanOrderId, global::System.Convert.ToString); - } - if (content.Contains("SavingsPlanId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanId = (string) content.GetValueForProperty("SavingsPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanId, global::System.Convert.ToString); - } - if (content.Contains("BillingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus.CreateFrom); - } - if (content.Contains("SavingsPlanPurchaseRequestProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanPurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("SavingsPlanPurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanPurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Commitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CommitmentTypeConverter.ConvertFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan.CreateFrom); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm.CreateFrom); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("CommitmentGrain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentGrain = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain?) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentGrain, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); - } - if (content.Contains("CommitmentCurrencyCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); - } - if (content.Contains("CommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal SavingsPlanToPurchaseExchange(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.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom); - } - if (content.Contains("SavingsPlanOrderId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanOrderId = (string) content.GetValueForProperty("SavingsPlanOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanOrderId, global::System.Convert.ToString); - } - if (content.Contains("SavingsPlanId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanId = (string) content.GetValueForProperty("SavingsPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanId, global::System.Convert.ToString); - } - if (content.Contains("BillingCurrencyTotal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus.CreateFrom); - } - if (content.Contains("SavingsPlanPurchaseRequestProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanPurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("SavingsPlanPurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanPurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Commitment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CommitmentTypeConverter.ConvertFrom); - } - if (content.Contains("BillingPlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan.CreateFrom); - } - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopeProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("DisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).DisplayName, global::System.Convert.ToString); - } - if (content.Contains("BillingScopeId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); - } - if (content.Contains("Term")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm.CreateFrom); - } - if (content.Contains("AppliedScopeType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); - } - if (content.Contains("AppliedScopePropertyTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertySubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyDisplayName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); - } - if (content.Contains("CommitmentGrain")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentGrain = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain?) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentGrain, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain.CreateFrom); - } - if (content.Contains("AppliedScopePropertyManagementGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); - } - if (content.Contains("AppliedScopePropertyResourceGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); - } - if (content.Contains("CommitmentCurrencyCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); - } - if (content.Contains("CommitmentAmount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); - } - 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Savings plan purchase details - [System.ComponentModel.TypeConverter(typeof(SavingsPlanToPurchaseExchangeTypeConverter))] - public partial interface ISavingsPlanToPurchaseExchange - - { - - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.PowerShell.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.PowerShell.cs index 408a61299c3e..2f69b9842c07 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AppliedReservationList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal AppliedReservationList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,37 @@ internal AppliedReservationList(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AppliedReservationList(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AppliedReservationList(content); } @@ -145,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.TypeConverter.cs index 9d3e27b439ab..b410b158bae3 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.cs index 00783e2ea275..4ac6bcda348e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Paginated list of applied reservations public partial class AppliedReservationList : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class AppliedReservationList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private string[] _value; + private System.Collections.Generic.List _value; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public string[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public AppliedReservationList() @@ -40,6 +40,9 @@ public partial interface IAppliedReservationList : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Url to get the next page of reservations", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -48,10 +51,13 @@ public partial interface IAppliedReservationList : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } /// Paginated list of applied reservations @@ -61,7 +67,7 @@ internal partial interface IAppliedReservationListInternal /// Url to get the next page of reservations string NextLink { get; set; } - string[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.json.cs index 9cc2160b1eee..ddc7ae7c7f5f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationList.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationList.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AppliedReservationList(Microsoft.Azure.PowerShell.Cmdlets.Reservations. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : 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.Reservations.Models.Api20221101.IAppliedReservationList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new AppliedReservationList(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.PowerShell.cs similarity index 63% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.PowerShell.cs index 1210345d8d5a..ea5dc0f8189f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AppliedReservations partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,37 +78,37 @@ internal AppliedReservations(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationsPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationsPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderId = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderId = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationListTypeConverter.ConvertFrom); } if (content.Contains("ReservationOrderIdValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderIdValue = (string[]) content.GetValueForProperty("ReservationOrderIdValue",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderIdValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderIdValue = (System.Collections.Generic.List) content.GetValueForProperty("ReservationOrderIdValue",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderIdValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ReservationOrderIdNextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderIdNextLink = (string) content.GetValueForProperty("ReservationOrderIdNextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderIdNextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderIdNextLink = (string) content.GetValueForProperty("ReservationOrderIdNextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderIdNextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -123,57 +123,57 @@ internal AppliedReservations(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationsPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationsPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderId = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderId = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationListTypeConverter.ConvertFrom); } if (content.Contains("ReservationOrderIdValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderIdValue = (string[]) content.GetValueForProperty("ReservationOrderIdValue",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderIdValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderIdValue = (System.Collections.Generic.List) content.GetValueForProperty("ReservationOrderIdValue",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderIdValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ReservationOrderIdNextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderIdNextLink = (string) content.GetValueForProperty("ReservationOrderIdNextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal)this).ReservationOrderIdNextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderIdNextLink = (string) content.GetValueForProperty("ReservationOrderIdNextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal)this).ReservationOrderIdNextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AppliedReservations(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AppliedReservations(content); } @@ -183,7 +183,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.TypeConverter.cs index 570747e1a46a..c5fca1675b76 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.cs similarity index 69% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.cs index 6aac4dd3bfdc..01fe2503b8bf 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.cs @@ -3,15 +3,15 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The response for applied reservations api [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] public partial class AppliedReservations : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal { /// Backing field for property. @@ -22,19 +22,19 @@ public partial class AppliedReservations : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationsProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationsProperties()); set { {_property = value;} } } /// Internal Acessors for ReservationOrderId - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal.ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)Property).ReservationOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)Property).ReservationOrderId = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal.ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)Property).ReservationOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)Property).ReservationOrderId = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -44,18 +44,18 @@ public partial class AppliedReservations : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties _property; /// Properties for applied reservations returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationsProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationsProperties()); set => this._property = value; } /// Url to get the next page of reservations [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationOrderIdNextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)Property).ReservationOrderIdNextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)Property).ReservationOrderIdNextLink = value ?? null; } + public string ReservationOrderIdNextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)Property).ReservationOrderIdNextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)Property).ReservationOrderIdNextLink = value ?? null; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string[] ReservationOrderIdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)Property).ReservationOrderIdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)Property).ReservationOrderIdValue = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ReservationOrderIdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)Property).ReservationOrderIdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)Property).ReservationOrderIdValue = value ?? null /* arrayOf */; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] @@ -82,6 +82,9 @@ public partial interface IAppliedReservations : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Identifier of the applied reservations", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -90,6 +93,9 @@ public partial interface IAppliedReservations : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of resource", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -98,6 +104,9 @@ public partial interface IAppliedReservations : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Url to get the next page of reservations", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -106,14 +115,20 @@ public partial interface IAppliedReservations : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] - string[] ReservationOrderIdValue { get; set; } + System.Collections.Generic.List ReservationOrderIdValue { get; set; } /// Type of resource. "Microsoft.Capacity/AppliedReservations" [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of resource. ""Microsoft.Capacity/AppliedReservations""", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -129,13 +144,13 @@ internal partial interface IAppliedReservationsInternal /// Name of resource string Name { get; set; } /// Properties for applied reservations returned - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties Property { get; set; } /// Paginated list of applied reservations - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList ReservationOrderId { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList ReservationOrderId { get; set; } /// Url to get the next page of reservations string ReservationOrderIdNextLink { get; set; } - string[] ReservationOrderIdValue { get; set; } + System.Collections.Generic.List ReservationOrderIdValue { get; set; } /// Type of resource. "Microsoft.Capacity/AppliedReservations" string Type { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.json.cs similarity index 91% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.json.cs index 6335c9bff796..4fcbe0fa0ce5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservations.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservations.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,21 +65,21 @@ internal AppliedReservations(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Run { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationsProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationsProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new AppliedReservations(json) : null; } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.PowerShell.cs similarity index 71% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.PowerShell.cs index 5c98ae94c544..5aae6da9005e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AppliedReservationsProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal AppliedReservationsProperties(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderId = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderId = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationListTypeConverter.ConvertFrom); } if (content.Contains("ReservationOrderIdValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdValue = (string[]) content.GetValueForProperty("ReservationOrderIdValue",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdValue = (System.Collections.Generic.List) content.GetValueForProperty("ReservationOrderIdValue",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ReservationOrderIdNextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdNextLink = (string) content.GetValueForProperty("ReservationOrderIdNextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdNextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdNextLink = (string) content.GetValueForProperty("ReservationOrderIdNextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdNextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,43 +107,41 @@ internal AppliedReservationsProperties(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderId = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderId = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationListTypeConverter.ConvertFrom); } if (content.Contains("ReservationOrderIdValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdValue = (string[]) content.GetValueForProperty("ReservationOrderIdValue",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdValue, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdValue = (System.Collections.Generic.List) content.GetValueForProperty("ReservationOrderIdValue",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdValue, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ReservationOrderIdNextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdNextLink = (string) content.GetValueForProperty("ReservationOrderIdNextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdNextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdNextLink = (string) content.GetValueForProperty("ReservationOrderIdNextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal)this).ReservationOrderIdNextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AppliedReservationsProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AppliedReservationsProperties(content); } @@ -153,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.TypeConverter.cs index 7d4c5c9a8659..f1d74da40399 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.cs similarity index 59% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.cs index 3cd0ec2d6965..130dd230ef76 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.cs @@ -3,32 +3,32 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties for applied reservations returned public partial class AppliedReservationsProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal { /// Internal Acessors for ReservationOrderId - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsPropertiesInternal.ReservationOrderId { get => (this._reservationOrderId = this._reservationOrderId ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationList()); set { {_reservationOrderId = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsPropertiesInternal.ReservationOrderId { get => (this._reservationOrderId = this._reservationOrderId ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationList()); set { {_reservationOrderId = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList _reservationOrderId; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList _reservationOrderId; /// Paginated list of applied reservations [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList ReservationOrderId { get => (this._reservationOrderId = this._reservationOrderId ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationList()); set => this._reservationOrderId = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList ReservationOrderId { get => (this._reservationOrderId = this._reservationOrderId ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationList()); set => this._reservationOrderId = value; } /// Url to get the next page of reservations [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationOrderIdNextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)ReservationOrderId).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)ReservationOrderId).NextLink = value ?? null; } + public string ReservationOrderIdNextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)ReservationOrderId).NextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)ReservationOrderId).NextLink = value ?? null; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string[] ReservationOrderIdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)ReservationOrderId).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationListInternal)ReservationOrderId).Value = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ReservationOrderIdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)ReservationOrderId).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationListInternal)ReservationOrderId).Value = value ?? null /* arrayOf */; } /// Creates an new instance. public AppliedReservationsProperties() @@ -44,6 +44,9 @@ public partial interface IAppliedReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Url to get the next page of reservations", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,13 @@ public partial interface IAppliedReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] - string[] ReservationOrderIdValue { get; set; } + System.Collections.Generic.List ReservationOrderIdValue { get; set; } } /// Properties for applied reservations returned @@ -63,11 +69,11 @@ internal partial interface IAppliedReservationsPropertiesInternal { /// Paginated list of applied reservations - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationList ReservationOrderId { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationList ReservationOrderId { get; set; } /// Url to get the next page of reservations string ReservationOrderIdNextLink { get; set; } - string[] ReservationOrderIdValue { get; set; } + System.Collections.Generic.List ReservationOrderIdValue { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.json.cs similarity index 93% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.json.cs index 76ac8496b593..0fe774e4af7e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedReservationsProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedReservationsProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AppliedReservationsProperties(Microsoft.Azure.PowerShell.Cmdlets.Reserv { return; } - {_reservationOrderId = If( json?.PropertyT("reservationOrderIds"), out var __jsonReservationOrderIds) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservationList.FromJson(__jsonReservationOrderIds) : ReservationOrderId;} + {_reservationOrderId = If( json?.PropertyT("reservationOrderIds"), out var __jsonReservationOrderIds) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservationList.FromJson(__jsonReservationOrderIds) : _reservationOrderId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservationsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservationsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new AppliedReservationsProperties(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.PowerShell.cs similarity index 71% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.PowerShell.cs index ed7217ad9e08..3445813cbb0b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -66,7 +66,7 @@ public partial class AppliedScopeProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -81,29 +81,29 @@ internal AppliedScopeProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("ManagementGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).ManagementGroupId = (string) content.GetValueForProperty("ManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).ManagementGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).ManagementGroupId = (string) content.GetValueForProperty("ManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).ManagementGroupId, global::System.Convert.ToString); } if (content.Contains("SubscriptionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); } if (content.Contains("ResourceGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).ResourceGroupId = (string) content.GetValueForProperty("ResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).ResourceGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).ResourceGroupId = (string) content.GetValueForProperty("ResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).ResourceGroupId, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).DisplayName, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -118,51 +118,49 @@ internal AppliedScopeProperties(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("ManagementGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).ManagementGroupId = (string) content.GetValueForProperty("ManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).ManagementGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).ManagementGroupId = (string) content.GetValueForProperty("ManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).ManagementGroupId, global::System.Convert.ToString); } if (content.Contains("SubscriptionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).SubscriptionId, global::System.Convert.ToString); } if (content.Contains("ResourceGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).ResourceGroupId = (string) content.GetValueForProperty("ResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).ResourceGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).ResourceGroupId = (string) content.GetValueForProperty("ResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).ResourceGroupId, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)this).DisplayName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AppliedScopeProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AppliedScopeProperties(content); } @@ -172,7 +170,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.TypeConverter.cs index f40c961aea8b..9cc6b1afc930 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.cs index 82aa63ebcbc3..f62ff247b98b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// if AppliedScopeType is ManagementGroup /// public partial class AppliedScopeProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal { /// Backing field for property. @@ -68,6 +68,9 @@ public partial interface IAppliedScopeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -78,6 +81,9 @@ public partial interface IAppliedScopeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -86,6 +92,9 @@ public partial interface IAppliedScopeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -94,6 +103,9 @@ public partial interface IAppliedScopeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -102,6 +114,9 @@ public partial interface IAppliedScopeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.json.cs index 0a7b17abe1a0..7bc4560aa721 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AppliedScopeProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AppliedScopeProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -68,22 +68,22 @@ internal AppliedScopeProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservations. { return; } - {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} - {_managementGroupId = If( json?.PropertyT("managementGroupId"), out var __jsonManagementGroupId) ? (string)__jsonManagementGroupId : (string)ManagementGroupId;} - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_resourceGroupId = If( json?.PropertyT("resourceGroupId"), out var __jsonResourceGroupId) ? (string)__jsonResourceGroupId : (string)ResourceGroupId;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} + {_managementGroupId = If( json?.PropertyT("managementGroupId"), out var __jsonManagementGroupId) ? (string)__jsonManagementGroupId : (string)_managementGroupId;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_resourceGroupId = If( json?.PropertyT("resourceGroupId"), out var __jsonResourceGroupId) ? (string)__jsonResourceGroupId : (string)_resourceGroupId;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new AppliedScopeProperties(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.PowerShell.cs similarity index 73% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.PowerShell.cs index e54fdee480f1..408f34a22b5c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AvailableScopeProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal AvailableScopeProperties(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopePropertiesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopePropertiesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SubscriptionScopePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopePropertiesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopePropertiesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SubscriptionScopePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopePropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ScopePropertiesTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopePropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ScopePropertiesTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,39 +103,37 @@ internal AvailableScopeProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopePropertiesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopePropertiesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SubscriptionScopePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopePropertiesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopePropertiesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SubscriptionScopePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopePropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ScopePropertiesTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopePropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ScopePropertiesTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AvailableScopeProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AvailableScopeProperties(content); } @@ -145,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.TypeConverter.cs index cda7e2fa4dc1..47c12006e7b3 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.cs similarity index 55% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.cs index 362a1d6e24dd..529b3e3f5186 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.cs @@ -3,28 +3,28 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The response of available scope api containing scopes and their eligibilities. public partial class AvailableScopeProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopePropertiesInternal { /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopePropertiesInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SubscriptionScopeProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopePropertiesInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SubscriptionScopeProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties _property; /// The scopes checked by the available scope api. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SubscriptionScopeProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SubscriptionScopeProperties()); set => this._property = value; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[] Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopePropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopePropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopePropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } /// Creates an new instance. public AvailableScopeProperties() @@ -39,10 +39,13 @@ public partial interface IAvailableScopeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"scopes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[] Scope { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties) })] + System.Collections.Generic.List Scope { get; set; } } /// The response of available scope api containing scopes and their eligibilities. @@ -50,9 +53,9 @@ internal partial interface IAvailableScopePropertiesInternal { /// The scopes checked by the available scope api. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties Property { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.json.cs index dcc525005272..dc0b6d4f71e7 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AvailableScopeProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservation { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SubscriptionScopeProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SubscriptionScopeProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new AvailableScopeProperties(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.PowerShell.cs similarity index 77% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.PowerShell.cs index d49ef14b11a8..17ac0d31c0d9 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AvailableScopeRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal AvailableScopeRequest(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AvailableScopeRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AvailableScopeRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -103,37 +103,37 @@ internal AvailableScopeRequest(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AvailableScopeRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AvailableScopeRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AvailableScopeRequest(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AvailableScopeRequest(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.TypeConverter.cs index 4268717133c7..d108aeb1145a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.cs similarity index 56% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.cs index 02fc29d3f903..148ad6265d29 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.cs @@ -3,28 +3,28 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Available scope public partial class AvailableScopeRequest : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestInternal { /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AvailableScopeRequestProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AvailableScopeRequestProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties _property; /// Available scope request properties [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AvailableScopeRequestProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AvailableScopeRequestProperties()); set => this._property = value; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string[] Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestPropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestPropertiesInternal)Property).Scope = value ?? null /* arrayOf */; } /// Creates an new instance. public AvailableScopeRequest() @@ -39,10 +39,13 @@ public partial interface IAvailableScopeRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } /// Available scope @@ -50,9 +53,9 @@ internal partial interface IAvailableScopeRequestInternal { /// Available scope request properties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties Property { get; set; } - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.json.cs index 6ac3ba64805e..2efb480bd854 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequest.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AvailableScopeRequest(Microsoft.Azure.PowerShell.Cmdlets.Reservations.R { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AvailableScopeRequestProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AvailableScopeRequestProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new AvailableScopeRequest(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.PowerShell.cs similarity index 82% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.PowerShell.cs index e0838bd7c232..6f127561eeba 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AvailableScopeRequestProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,13 +78,13 @@ internal AvailableScopeRequestProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestPropertiesInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestPropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestPropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestPropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,35 +99,33 @@ internal AvailableScopeRequestProperties(global::System.Management.Automation.PS // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestPropertiesInternal)this).Scope = (string[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestPropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestPropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestPropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AvailableScopeRequestProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AvailableScopeRequestProperties(content); } @@ -137,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.TypeConverter.cs index 013172ad0dad..251eeabb5543 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.cs similarity index 72% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.cs index 244620980195..e21bf8c64a9d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Available scope request properties public partial class AvailableScopeRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestPropertiesInternal { /// Backing field for property. - private string[] _scope; + private System.Collections.Generic.List _scope; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public string[] Scope { get => this._scope; set => this._scope = value; } + public System.Collections.Generic.List Scope { get => this._scope; set => this._scope = value; } /// Creates an new instance. public AvailableScopeRequestProperties() @@ -32,17 +32,20 @@ public partial interface IAvailableScopeRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } /// Available scope request properties internal partial interface IAvailableScopeRequestPropertiesInternal { - string[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.json.cs index c32f4abf7ce2..fcc4e771c248 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/AvailableScopeRequestProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/AvailableScopeRequestProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AvailableScopeRequestProperties(Microsoft.Azure.PowerShell.Cmdlets.Rese { return; } - {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? If( __jsonScopes as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Scope;} + {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? If( __jsonScopes as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _scope;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new AvailableScopeRequestProperties(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.PowerShell.cs similarity index 69% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.PowerShell.cs index c36d5c29509c..3b7554ff5e3b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class BillingInformation partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal BillingInformation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("BillingCurrencyTotalPaidAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyProratedAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyRemainingCommitmentAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,41 +107,41 @@ internal BillingInformation(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("BillingCurrencyTotalPaidAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyProratedAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyRemainingCommitmentAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BillingInformation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BillingInformation(content); } @@ -151,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.TypeConverter.cs index 6578e2d58a53..5c5c64ca0496 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.cs similarity index 64% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.cs index b6a34b73fcda..ff4ed786ecf6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.cs @@ -3,38 +3,38 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// billing information public partial class BillingInformation : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformationInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyProratedAmount; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyProratedAmount; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyProratedAmount { get => (this._billingCurrencyProratedAmount = this._billingCurrencyProratedAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyProratedAmount = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyProratedAmount { get => (this._billingCurrencyProratedAmount = this._billingCurrencyProratedAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyProratedAmount = value; } /// /// Backing field for property. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyRemainingCommitmentAmount; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyRemainingCommitmentAmount; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyRemainingCommitmentAmount { get => (this._billingCurrencyRemainingCommitmentAmount = this._billingCurrencyRemainingCommitmentAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyRemainingCommitmentAmount = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyRemainingCommitmentAmount { get => (this._billingCurrencyRemainingCommitmentAmount = this._billingCurrencyRemainingCommitmentAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyRemainingCommitmentAmount = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyTotalPaidAmount; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyTotalPaidAmount; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotalPaidAmount { get => (this._billingCurrencyTotalPaidAmount = this._billingCurrencyTotalPaidAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyTotalPaidAmount = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotalPaidAmount { get => (this._billingCurrencyTotalPaidAmount = this._billingCurrencyTotalPaidAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyTotalPaidAmount = value; } /// Creates an new instance. public BillingInformation() @@ -50,26 +50,35 @@ public partial interface IBillingInformation : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyProratedAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyProratedAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyProratedAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyRemainingCommitmentAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyRemainingCommitmentAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyRemainingCommitmentAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyTotalPaidAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotalPaidAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotalPaidAmount { get; set; } } /// billing information @@ -77,11 +86,11 @@ internal partial interface IBillingInformationInternal { /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyProratedAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyProratedAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyRemainingCommitmentAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyRemainingCommitmentAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotalPaidAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotalPaidAmount { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.json.cs similarity index 91% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.json.cs index ecbc2986f406..6d772ad6ccfd 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/BillingInformation.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/BillingInformation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,20 +65,20 @@ internal BillingInformation(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runt { return; } - {_billingCurrencyTotalPaidAmount = If( json?.PropertyT("billingCurrencyTotalPaidAmount"), out var __jsonBillingCurrencyTotalPaidAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyTotalPaidAmount) : BillingCurrencyTotalPaidAmount;} - {_billingCurrencyProratedAmount = If( json?.PropertyT("billingCurrencyProratedAmount"), out var __jsonBillingCurrencyProratedAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyProratedAmount) : BillingCurrencyProratedAmount;} - {_billingCurrencyRemainingCommitmentAmount = If( json?.PropertyT("billingCurrencyRemainingCommitmentAmount"), out var __jsonBillingCurrencyRemainingCommitmentAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyRemainingCommitmentAmount) : BillingCurrencyRemainingCommitmentAmount;} + {_billingCurrencyTotalPaidAmount = If( json?.PropertyT("billingCurrencyTotalPaidAmount"), out var __jsonBillingCurrencyTotalPaidAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyTotalPaidAmount) : _billingCurrencyTotalPaidAmount;} + {_billingCurrencyProratedAmount = If( json?.PropertyT("billingCurrencyProratedAmount"), out var __jsonBillingCurrencyProratedAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyProratedAmount) : _billingCurrencyProratedAmount;} + {_billingCurrencyRemainingCommitmentAmount = If( json?.PropertyT("billingCurrencyRemainingCommitmentAmount"), out var __jsonBillingCurrencyRemainingCommitmentAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyRemainingCommitmentAmount) : _billingCurrencyRemainingCommitmentAmount;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new BillingInformation(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.PowerShell.cs new file mode 100644 index 000000000000..45dc4b891bda --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.PowerShell.cs @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// CalculateExchange operation result + [System.ComponentModel.TypeConverter(typeof(CalculateExchangeOperationResultResponseTypeConverter))] + public partial class CalculateExchangeOperationResultResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CalculateExchangeOperationResultResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Properties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeResponsePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("NetPayable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("RefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasesTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ReservationsToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("SavingsPlansToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ReservationsToExchange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("PolicyResultPolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PolicyResultPolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CalculateExchangeOperationResultResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Properties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeResponsePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("NetPayable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("RefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasesTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ReservationsToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("SavingsPlansToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ReservationsToExchange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("PolicyResultPolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PolicyResultPolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorTypeConverter.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.Reservations.Models.ICalculateExchangeOperationResultResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CalculateExchangeOperationResultResponse(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.Reservations.Models.ICalculateExchangeOperationResultResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CalculateExchangeOperationResultResponse(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.Reservations.Models.ICalculateExchangeOperationResultResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// CalculateExchange operation result + [System.ComponentModel.TypeConverter(typeof(CalculateExchangeOperationResultResponseTypeConverter))] + public partial interface ICalculateExchangeOperationResultResponse + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.TypeConverter.cs index bb4e1be53a5e..e569f94993ce 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.cs similarity index 61% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.cs index f157b081aa85..e345e4408548 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// CalculateExchange operation result public partial class CalculateExchangeOperationResultResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal { /// @@ -19,15 +19,15 @@ public partial class CalculateExchangeOperationResultResponse : /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)Error).Code = value ?? null; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)Error).Code = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError _error; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError _error; /// Required if status == failed or status == canceled. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultError()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultError()); set => this._error = value; } /// Backing field for property. private string _id; @@ -43,16 +43,16 @@ public partial class CalculateExchangeOperationResultResponse : /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)Error).Message = value ?? null; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)Error).Message = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultError()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultError()); set { {_error = value;} } } /// Internal Acessors for PolicyResult - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal.PolicyResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).PolicyResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).PolicyResult = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal.PolicyResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).PolicyResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).PolicyResult = value; } /// Internal Acessors for Properties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponseInternal.Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeResponseProperties()); set { {_properties = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponseInternal.Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeResponseProperties()); set { {_properties = value;} } } /// Backing field for property. private string _name; @@ -67,40 +67,40 @@ public partial class CalculateExchangeOperationResultResponse : /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).NetPayable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).NetPayable = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).NetPayable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).NetPayable = value ?? null /* model class */; } /// Exchange Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).PolicyResultPolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).PolicyResultPolicyError = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PolicyResultPolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).PolicyResultPolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).PolicyResultPolicyError = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties _properties; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties _properties; /// CalculateExchange response properties [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeResponseProperties()); set => this._properties = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeResponseProperties()); set => this._properties = value; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).PurchasesTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).PurchasesTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).PurchasesTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).PurchasesTotal = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).RefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).RefundsTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).RefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).RefundsTotal = value ?? null /* model class */; } /// Details of the reservations being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[] ReservationsToExchange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).ReservationsToExchange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).ReservationsToExchange = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ReservationsToExchange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).ReservationsToExchange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).ReservationsToExchange = value ?? null /* arrayOf */; } /// Details of the reservations being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[] ReservationsToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).ReservationsToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).ReservationsToPurchase = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ReservationsToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).ReservationsToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).ReservationsToPurchase = value ?? null /* arrayOf */; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] @@ -110,20 +110,20 @@ public partial class CalculateExchangeOperationResultResponse : /// Details of the savings plans being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[] SavingsPlansToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).SavingsPlansToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).SavingsPlansToPurchase = value ?? null /* arrayOf */; } + public System.Collections.Generic.List SavingsPlansToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).SavingsPlansToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).SavingsPlansToPurchase = value ?? null /* arrayOf */; } /// Exchange session identifier [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 0)] - public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal)Properties).SessionId = value ?? null; } + public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)Properties).SessionId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus? _status; + private string _status; /// Status of the operation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 1)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// /// Creates an new instance. @@ -144,6 +144,9 @@ public partial interface ICalculateExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Required if status == failed or status == cancelled. If status == failed, provide an invariant error code used for error troubleshooting, aggregation, and analysis.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -152,6 +155,9 @@ public partial interface ICalculateExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"It should match what is used to GET the operation result.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +169,9 @@ public partial interface ICalculateExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Required if status == failed. Localized. If status == failed, provide an actionable error message indicating what error occurred, and what the user can do to address the issue.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -173,6 +182,9 @@ public partial interface ICalculateExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"It must match the last segment of the id field, and will typically be a GUID / system generated value.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -181,62 +193,86 @@ public partial interface ICalculateExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"netPayable", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get; set; } /// Exchange Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Exchange Policy errors", SerializedName = @"policyErrors", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError) })] + System.Collections.Generic.List PolicyResultPolicyError { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"purchasesTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"refundsTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get; set; } /// Details of the reservations being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the reservations being returned", SerializedName = @"reservationsToExchange", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[] ReservationsToExchange { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange) })] + System.Collections.Generic.List ReservationsToExchange { get; set; } /// Details of the reservations being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the reservations being purchased", SerializedName = @"reservationsToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[] ReservationsToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchange) })] + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// Details of the savings plans being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the savings plans being purchased", SerializedName = @"savingsPlansToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[] SavingsPlansToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange) })] + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } /// Exchange session identifier [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Exchange session identifier", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] @@ -245,10 +281,14 @@ public partial interface ICalculateExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Status of the operation.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending")] + string Status { get; set; } } /// CalculateExchange operation result @@ -261,7 +301,7 @@ internal partial interface ICalculateExchangeOperationResultResponseInternal /// string Code { get; set; } /// Required if status == failed or status == canceled. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError Error { get; set; } /// It should match what is used to GET the operation result. string Id { get; set; } /// @@ -274,27 +314,28 @@ internal partial interface ICalculateExchangeOperationResultResponseInternal /// string Name { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get; set; } /// Exchange policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors PolicyResult { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors PolicyResult { get; set; } /// Exchange Policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get; set; } + System.Collections.Generic.List PolicyResultPolicyError { get; set; } /// CalculateExchange response properties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties Properties { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties Properties { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get; set; } /// Details of the reservations being returned - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[] ReservationsToExchange { get; set; } + System.Collections.Generic.List ReservationsToExchange { get; set; } /// Details of the reservations being purchased - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[] ReservationsToPurchase { get; set; } + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// Details of the savings plans being purchased - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[] SavingsPlansToPurchase { get; set; } + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } /// Exchange session identifier string SessionId { get; set; } /// Status of the operation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.json.cs index 63715554ae5f..f904ead9f796 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeOperationResultResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeOperationResultResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,22 +65,22 @@ internal CalculateExchangeOperationResultResponse(Microsoft.Azure.PowerShell.Cmd { return; } - {_properties = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeResponseProperties.FromJson(__jsonProperties) : Properties;} - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultError.FromJson(__jsonError) : Error;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_properties = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeResponseProperties.FromJson(__jsonProperties) : _properties;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultError.FromJson(__jsonError) : _error;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculateExchangeOperationResultResponse(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.PowerShell.cs similarity index 61% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.PowerShell.cs index c49b740cdc23..adcde49eddb7 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CalculateExchangeRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,25 +78,25 @@ internal CalculateExchangeRequest(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ReservationsToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom)); } if (content.Contains("SavingsPlansToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom)); } if (content.Contains("ReservationsToExchange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -111,47 +111,45 @@ internal CalculateExchangeRequest(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ReservationsToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom)); } if (content.Contains("SavingsPlansToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom)); } if (content.Contains("ReservationsToExchange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CalculateExchangeRequest(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CalculateExchangeRequest(content); } @@ -161,7 +159,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.TypeConverter.cs index 3e905b7dea72..b3df3868f0c3 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.cs similarity index 51% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.cs index 94afd9f73755..22c414f490d5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.cs @@ -3,37 +3,37 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Calculate exchange request public partial class CalculateExchangeRequest : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal { /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeRequestProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeRequestProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties _property; /// Calculate exchange request properties [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeRequestProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeRequestProperties()); set => this._property = value; } /// List of reservations that are being returned in this exchange. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[] ReservationsToExchange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)Property).ReservationsToExchange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)Property).ReservationsToExchange = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ReservationsToExchange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)Property).ReservationsToExchange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)Property).ReservationsToExchange = value ?? null /* arrayOf */; } /// List of reservations that are being purchased in this exchange. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[] ReservationsToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)Property).ReservationsToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)Property).ReservationsToPurchase = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ReservationsToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)Property).ReservationsToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)Property).ReservationsToPurchase = value ?? null /* arrayOf */; } /// List of savings plans that are being purchased in this exchange. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[] SavingsPlansToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)Property).SavingsPlansToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)Property).SavingsPlansToPurchase = value ?? null /* arrayOf */; } + public System.Collections.Generic.List SavingsPlansToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)Property).SavingsPlansToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)Property).SavingsPlansToPurchase = value ?? null /* arrayOf */; } /// Creates an new instance. public CalculateExchangeRequest() @@ -49,26 +49,35 @@ public partial interface ICalculateExchangeRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of reservations that are being returned in this exchange.", SerializedName = @"reservationsToExchange", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[] ReservationsToExchange { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) })] + System.Collections.Generic.List ReservationsToExchange { get; set; } /// List of reservations that are being purchased in this exchange. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of reservations that are being purchased in this exchange.", SerializedName = @"reservationsToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[] ReservationsToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) })] + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// List of savings plans that are being purchased in this exchange. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of savings plans that are being purchased in this exchange.", SerializedName = @"savingsPlansToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[] SavingsPlansToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest) })] + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } } /// Calculate exchange request @@ -76,13 +85,13 @@ internal partial interface ICalculateExchangeRequestInternal { /// Calculate exchange request properties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties Property { get; set; } /// List of reservations that are being returned in this exchange. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[] ReservationsToExchange { get; set; } + System.Collections.Generic.List ReservationsToExchange { get; set; } /// List of reservations that are being purchased in this exchange. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[] ReservationsToPurchase { get; set; } + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// List of savings plans that are being purchased in this exchange. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[] SavingsPlansToPurchase { get; set; } + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.json.cs index 26a49b682875..d19a3ec98c54 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequest.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,18 @@ internal CalculateExchangeRequest(Microsoft.Azure.PowerShell.Cmdlets.Reservation { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeRequestProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeRequestProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculateExchangeRequest(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.PowerShell.cs similarity index 64% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.PowerShell.cs index 7180cbcbdf61..70d8a5f3a20f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CalculateExchangeRequestProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal CalculateExchangeRequestProperties(global::System.Collections.IDictiona // actually deserialize if (content.Contains("ReservationsToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom)); } if (content.Contains("SavingsPlansToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom)); } if (content.Contains("ReservationsToExchange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,43 +107,43 @@ internal CalculateExchangeRequestProperties(global::System.Management.Automation // actually deserialize if (content.Contains("ReservationsToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom)); } if (content.Contains("SavingsPlansToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom)); } if (content.Contains("ReservationsToExchange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CalculateExchangeRequestProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CalculateExchangeRequestProperties(content); } @@ -155,7 +155,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.TypeConverter.cs index 706200c6d808..264997eeffd8 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.cs similarity index 57% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.cs index 1b836ce3c446..814dce7a73a6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.cs @@ -3,36 +3,36 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Calculate exchange request properties public partial class CalculateExchangeRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[] _reservationsToExchange; + private System.Collections.Generic.List _reservationsToExchange; /// List of reservations that are being returned in this exchange. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[] ReservationsToExchange { get => this._reservationsToExchange; set => this._reservationsToExchange = value; } + public System.Collections.Generic.List ReservationsToExchange { get => this._reservationsToExchange; set => this._reservationsToExchange = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[] _reservationsToPurchase; + private System.Collections.Generic.List _reservationsToPurchase; /// List of reservations that are being purchased in this exchange. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[] ReservationsToPurchase { get => this._reservationsToPurchase; set => this._reservationsToPurchase = value; } + public System.Collections.Generic.List ReservationsToPurchase { get => this._reservationsToPurchase; set => this._reservationsToPurchase = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[] _savingsPlansToPurchase; + private System.Collections.Generic.List _savingsPlansToPurchase; /// List of savings plans that are being purchased in this exchange. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[] SavingsPlansToPurchase { get => this._savingsPlansToPurchase; set => this._savingsPlansToPurchase = value; } + public System.Collections.Generic.List SavingsPlansToPurchase { get => this._savingsPlansToPurchase; set => this._savingsPlansToPurchase = value; } /// Creates an new instance. public CalculateExchangeRequestProperties() @@ -48,26 +48,35 @@ public partial interface ICalculateExchangeRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of reservations that are being returned in this exchange.", SerializedName = @"reservationsToExchange", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[] ReservationsToExchange { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) })] + System.Collections.Generic.List ReservationsToExchange { get; set; } /// List of reservations that are being purchased in this exchange. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of reservations that are being purchased in this exchange.", SerializedName = @"reservationsToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[] ReservationsToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) })] + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// List of savings plans that are being purchased in this exchange. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of savings plans that are being purchased in this exchange.", SerializedName = @"savingsPlansToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[] SavingsPlansToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest) })] + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } } /// Calculate exchange request properties @@ -75,11 +84,11 @@ internal partial interface ICalculateExchangeRequestPropertiesInternal { /// List of reservations that are being returned in this exchange. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[] ReservationsToExchange { get; set; } + System.Collections.Generic.List ReservationsToExchange { get; set; } /// List of reservations that are being purchased in this exchange. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[] ReservationsToPurchase { get; set; } + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// List of savings plans that are being purchased in this exchange. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[] SavingsPlansToPurchase { get; set; } + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.json.cs similarity index 83% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.json.cs index ab6a514d7176..57b0dd7467e4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeRequestProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeRequestProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,20 +65,20 @@ internal CalculateExchangeRequestProperties(Microsoft.Azure.PowerShell.Cmdlets.R { return; } - {_reservationsToPurchase = If( json?.PropertyT("reservationsToPurchase"), out var __jsonReservationsToPurchase) ? If( __jsonReservationsToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IPurchaseRequest) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest.FromJson(__u) )) ))() : null : ReservationsToPurchase;} - {_savingsPlansToPurchase = If( json?.PropertyT("savingsPlansToPurchase"), out var __jsonSavingsPlansToPurchase) ? If( __jsonSavingsPlansToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequest.FromJson(__p) )) ))() : null : SavingsPlansToPurchase;} - {_reservationsToExchange = If( json?.PropertyT("reservationsToExchange"), out var __jsonReservationsToExchange) ? If( __jsonReservationsToExchange as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturn.FromJson(__k) )) ))() : null : ReservationsToExchange;} + {_reservationsToPurchase = If( json?.PropertyT("reservationsToPurchase"), out var __jsonReservationsToPurchase) ? If( __jsonReservationsToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest.FromJson(__u) )) ))() : null : _reservationsToPurchase;} + {_savingsPlansToPurchase = If( json?.PropertyT("savingsPlansToPurchase"), out var __jsonSavingsPlansToPurchase) ? If( __jsonSavingsPlansToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequest.FromJson(__p) )) ))() : null : _savingsPlansToPurchase;} + {_reservationsToExchange = If( json?.PropertyT("reservationsToExchange"), out var __jsonReservationsToExchange) ? If( __jsonReservationsToExchange as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturn.FromJson(__k) )) ))() : null : _reservationsToExchange;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculateExchangeRequestProperties(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.PowerShell.cs new file mode 100644 index 000000000000..989ebd1c3deb --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.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.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// CalculateExchange response properties + [System.ComponentModel.TypeConverter(typeof(CalculateExchangeResponsePropertiesTypeConverter))] + public partial class CalculateExchangeResponseProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CalculateExchangeResponseProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("NetPayable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("RefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasesTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ReservationsToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("SavingsPlansToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ReservationsToExchange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("PolicyResultPolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PolicyResultPolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CalculateExchangeResponseProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("NetPayable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("RefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasesTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ReservationsToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("SavingsPlansToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseCalculateExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ReservationsToExchange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("PolicyResultPolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PolicyResultPolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorTypeConverter.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.Reservations.Models.ICalculateExchangeResponseProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CalculateExchangeResponseProperties(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.Reservations.Models.ICalculateExchangeResponseProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CalculateExchangeResponseProperties(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.Reservations.Models.ICalculateExchangeResponseProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// CalculateExchange response properties + [System.ComponentModel.TypeConverter(typeof(CalculateExchangeResponsePropertiesTypeConverter))] + public partial interface ICalculateExchangeResponseProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.TypeConverter.cs index 3a075332eb9a..0c2c6c1e04e5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.cs similarity index 57% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.cs index 8b24509e33e1..88e01e55f19b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.cs @@ -3,71 +3,71 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// CalculateExchange response properties public partial class CalculateExchangeResponseProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal { /// Internal Acessors for PolicyResult - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponsePropertiesInternal.PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrors()); set { {_policyResult = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponsePropertiesInternal.PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrors()); set { {_policyResult = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _netPayable; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _netPayable; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get => (this._netPayable = this._netPayable ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._netPayable = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get => (this._netPayable = this._netPayable ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._netPayable = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors _policyResult; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors _policyResult; /// Exchange policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrors()); set => this._policyResult = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrors()); set => this._policyResult = value; } /// Exchange Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorsInternal)PolicyResult).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorsInternal)PolicyResult).PolicyError = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PolicyResultPolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorsInternal)PolicyResult).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorsInternal)PolicyResult).PolicyError = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _purchasesTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _purchasesTotal; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get => (this._purchasesTotal = this._purchasesTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._purchasesTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get => (this._purchasesTotal = this._purchasesTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._purchasesTotal = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _refundsTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _refundsTotal; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get => (this._refundsTotal = this._refundsTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._refundsTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get => (this._refundsTotal = this._refundsTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._refundsTotal = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[] _reservationsToExchange; + private System.Collections.Generic.List _reservationsToExchange; /// Details of the reservations being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[] ReservationsToExchange { get => this._reservationsToExchange; set => this._reservationsToExchange = value; } + public System.Collections.Generic.List ReservationsToExchange { get => this._reservationsToExchange; set => this._reservationsToExchange = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[] _reservationsToPurchase; + private System.Collections.Generic.List _reservationsToPurchase; /// Details of the reservations being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[] ReservationsToPurchase { get => this._reservationsToPurchase; set => this._reservationsToPurchase = value; } + public System.Collections.Generic.List ReservationsToPurchase { get => this._reservationsToPurchase; set => this._reservationsToPurchase = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[] _savingsPlansToPurchase; + private System.Collections.Generic.List _savingsPlansToPurchase; /// Details of the savings plans being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[] SavingsPlansToPurchase { get => this._savingsPlansToPurchase; set => this._savingsPlansToPurchase = value; } + public System.Collections.Generic.List SavingsPlansToPurchase { get => this._savingsPlansToPurchase; set => this._savingsPlansToPurchase = value; } /// Backing field for property. private string _sessionId; @@ -90,62 +90,86 @@ public partial interface ICalculateExchangeResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"netPayable", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get; set; } /// Exchange Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Exchange Policy errors", SerializedName = @"policyErrors", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError) })] + System.Collections.Generic.List PolicyResultPolicyError { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"purchasesTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"refundsTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get; set; } /// Details of the reservations being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the reservations being returned", SerializedName = @"reservationsToExchange", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[] ReservationsToExchange { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange) })] + System.Collections.Generic.List ReservationsToExchange { get; set; } /// Details of the reservations being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the reservations being purchased", SerializedName = @"reservationsToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[] ReservationsToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchange) })] + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// Details of the savings plans being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the savings plans being purchased", SerializedName = @"savingsPlansToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[] SavingsPlansToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange) })] + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } /// Exchange session identifier [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Exchange session identifier", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] @@ -157,21 +181,21 @@ internal partial interface ICalculateExchangeResponsePropertiesInternal { /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get; set; } /// Exchange policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors PolicyResult { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors PolicyResult { get; set; } /// Exchange Policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get; set; } + System.Collections.Generic.List PolicyResultPolicyError { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get; set; } /// Details of the reservations being returned - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange[] ReservationsToExchange { get; set; } + System.Collections.Generic.List ReservationsToExchange { get; set; } /// Details of the reservations being purchased - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange[] ReservationsToPurchase { get; set; } + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// Details of the savings plans being purchased - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange[] SavingsPlansToPurchase { get; set; } + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } /// Exchange session identifier string SessionId { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.json.cs similarity index 82% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.json.cs index b007a26f05a8..6d6761e48d75 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateExchangeResponseProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateExchangeResponseProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,25 +65,25 @@ internal CalculateExchangeResponseProperties(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_policyResult = If( json?.PropertyT("policyResult"), out var __jsonPolicyResult) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrors.FromJson(__jsonPolicyResult) : PolicyResult;} - {_sessionId = If( json?.PropertyT("sessionId"), out var __jsonSessionId) ? (string)__jsonSessionId : (string)SessionId;} - {_netPayable = If( json?.PropertyT("netPayable"), out var __jsonNetPayable) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonNetPayable) : NetPayable;} - {_refundsTotal = If( json?.PropertyT("refundsTotal"), out var __jsonRefundsTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonRefundsTotal) : RefundsTotal;} - {_purchasesTotal = If( json?.PropertyT("purchasesTotal"), out var __jsonPurchasesTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonPurchasesTotal) : PurchasesTotal;} - {_reservationsToPurchase = If( json?.PropertyT("reservationsToPurchase"), out var __jsonReservationsToPurchase) ? If( __jsonReservationsToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseCalculateExchange.FromJson(__u) )) ))() : null : ReservationsToPurchase;} - {_savingsPlansToPurchase = If( json?.PropertyT("savingsPlansToPurchase"), out var __jsonSavingsPlansToPurchase) ? If( __jsonSavingsPlansToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseCalculateExchange.FromJson(__p) )) ))() : null : SavingsPlansToPurchase;} - {_reservationsToExchange = If( json?.PropertyT("reservationsToExchange"), out var __jsonReservationsToExchange) ? If( __jsonReservationsToExchange as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToExchange.FromJson(__k) )) ))() : null : ReservationsToExchange;} + {_policyResult = If( json?.PropertyT("policyResult"), out var __jsonPolicyResult) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrors.FromJson(__jsonPolicyResult) : _policyResult;} + {_sessionId = If( json?.PropertyT("sessionId"), out var __jsonSessionId) ? (string)__jsonSessionId : (string)_sessionId;} + {_netPayable = If( json?.PropertyT("netPayable"), out var __jsonNetPayable) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonNetPayable) : _netPayable;} + {_refundsTotal = If( json?.PropertyT("refundsTotal"), out var __jsonRefundsTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonRefundsTotal) : _refundsTotal;} + {_purchasesTotal = If( json?.PropertyT("purchasesTotal"), out var __jsonPurchasesTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonPurchasesTotal) : _purchasesTotal;} + {_reservationsToPurchase = If( json?.PropertyT("reservationsToPurchase"), out var __jsonReservationsToPurchase) ? If( __jsonReservationsToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseCalculateExchange.FromJson(__u) )) ))() : null : _reservationsToPurchase;} + {_savingsPlansToPurchase = If( json?.PropertyT("savingsPlansToPurchase"), out var __jsonSavingsPlansToPurchase) ? If( __jsonSavingsPlansToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseCalculateExchange.FromJson(__p) )) ))() : null : _savingsPlansToPurchase;} + {_reservationsToExchange = If( json?.PropertyT("reservationsToExchange"), out var __jsonReservationsToExchange) ? If( __jsonReservationsToExchange as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToExchange.FromJson(__k) )) ))() : null : _reservationsToExchange;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeResponseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeResponseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculateExchangeResponseProperties(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.PowerShell.cs similarity index 52% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.PowerShell.cs index 666279691613..eafa28004416 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CalculatePriceResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,57 +78,57 @@ internal CalculatePriceResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesBillingCurrencyTotalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesBillingCurrencyTotalTypeConverter.ConvertFrom); } if (content.Contains("NetTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).NetTotal = (double?) content.GetValueForProperty("NetTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).NetTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).NetTotal = (double?) content.GetValueForProperty("NetTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).NetTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("TaxTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).TaxTotal = (double?) content.GetValueForProperty("TaxTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).TaxTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).TaxTotal = (double?) content.GetValueForProperty("TaxTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).TaxTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("GrandTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).GrandTotal = (double?) content.GetValueForProperty("GrandTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).GrandTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).GrandTotal = (double?) content.GetValueForProperty("GrandTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).GrandTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("IsTaxIncluded")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).IsTaxIncluded = (bool?) content.GetValueForProperty("IsTaxIncluded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).IsTaxIncluded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).IsTaxIncluded = (bool?) content.GetValueForProperty("IsTaxIncluded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).IsTaxIncluded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsBillingPartnerManaged")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).IsBillingPartnerManaged = (bool?) content.GetValueForProperty("IsBillingPartnerManaged",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).IsBillingPartnerManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).IsBillingPartnerManaged = (bool?) content.GetValueForProperty("IsBillingPartnerManaged",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).IsBillingPartnerManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).ReservationOrderId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).ReservationOrderId, global::System.Convert.ToString); } if (content.Contains("SkuTitle")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).SkuTitle = (string) content.GetValueForProperty("SkuTitle",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).SkuTitle, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).SkuTitle = (string) content.GetValueForProperty("SkuTitle",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).SkuTitle, global::System.Convert.ToString); } if (content.Contains("SkuDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).SkuDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).SkuDescription, global::System.Convert.ToString); } if (content.Contains("PricingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesPricingCurrencyTotalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesPricingCurrencyTotalTypeConverter.ConvertFrom); } if (content.Contains("PaymentSchedule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).PaymentSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[]) content.GetValueForProperty("PaymentSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).PaymentSchedule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).PaymentSchedule = (System.Collections.Generic.List) content.GetValueForProperty("PaymentSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).PaymentSchedule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetailTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -143,79 +143,77 @@ internal CalculatePriceResponse(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesBillingCurrencyTotalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesBillingCurrencyTotalTypeConverter.ConvertFrom); } if (content.Contains("NetTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).NetTotal = (double?) content.GetValueForProperty("NetTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).NetTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).NetTotal = (double?) content.GetValueForProperty("NetTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).NetTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("TaxTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).TaxTotal = (double?) content.GetValueForProperty("TaxTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).TaxTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).TaxTotal = (double?) content.GetValueForProperty("TaxTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).TaxTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("GrandTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).GrandTotal = (double?) content.GetValueForProperty("GrandTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).GrandTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).GrandTotal = (double?) content.GetValueForProperty("GrandTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).GrandTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("IsTaxIncluded")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).IsTaxIncluded = (bool?) content.GetValueForProperty("IsTaxIncluded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).IsTaxIncluded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).IsTaxIncluded = (bool?) content.GetValueForProperty("IsTaxIncluded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).IsTaxIncluded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsBillingPartnerManaged")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).IsBillingPartnerManaged = (bool?) content.GetValueForProperty("IsBillingPartnerManaged",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).IsBillingPartnerManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).IsBillingPartnerManaged = (bool?) content.GetValueForProperty("IsBillingPartnerManaged",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).IsBillingPartnerManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).ReservationOrderId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).ReservationOrderId, global::System.Convert.ToString); } if (content.Contains("SkuTitle")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).SkuTitle = (string) content.GetValueForProperty("SkuTitle",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).SkuTitle, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).SkuTitle = (string) content.GetValueForProperty("SkuTitle",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).SkuTitle, global::System.Convert.ToString); } if (content.Contains("SkuDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).SkuDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).SkuDescription, global::System.Convert.ToString); } if (content.Contains("PricingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesPricingCurrencyTotalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesPricingCurrencyTotalTypeConverter.ConvertFrom); } if (content.Contains("PaymentSchedule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).PaymentSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[]) content.GetValueForProperty("PaymentSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal)this).PaymentSchedule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).PaymentSchedule = (System.Collections.Generic.List) content.GetValueForProperty("PaymentSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal)this).PaymentSchedule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetailTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CalculatePriceResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CalculatePriceResponse(content); } @@ -225,7 +223,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.TypeConverter.cs index 5a94752cc651..07b1364b1517 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.cs similarity index 63% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.cs index 24faffc0858d..151894169616 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.cs @@ -3,74 +3,74 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The response of calculate price for reservation. public partial class CalculatePriceResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal { /// /// Currency and amount that customer will be charged in customer's local currency. Tax is not included. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).BillingCurrencyTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).BillingCurrencyTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).BillingCurrencyTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).BillingCurrencyTotal = value ?? null /* model class */; } /// Total amount in pricing currency. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public double? GrandTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).GrandTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).GrandTotal = value ?? default(double); } + public double? GrandTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).GrandTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).GrandTotal = value ?? default(double); } /// True if billing is managed by Microsoft Partner. Used only for CSP accounts. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public bool? IsBillingPartnerManaged { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).IsBillingPartnerManaged; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).IsBillingPartnerManaged = value ?? default(bool); } + public bool? IsBillingPartnerManaged { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).IsBillingPartnerManaged; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).IsBillingPartnerManaged = value ?? default(bool); } /// Whether or not tax is included in grand total [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public bool? IsTaxIncluded { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).IsTaxIncluded; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).IsTaxIncluded = value ?? default(bool); } + public bool? IsTaxIncluded { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).IsTaxIncluded; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).IsTaxIncluded = value ?? default(bool); } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponseProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponseProperties()); set { {_property = value;} } } /// Net total amount in pricing currency. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public double? NetTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).NetTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).NetTotal = value ?? default(double); } + public double? NetTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).NetTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).NetTotal = value ?? default(double); } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PaymentSchedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).PaymentSchedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).PaymentSchedule = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PaymentSchedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).PaymentSchedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).PaymentSchedule = value ?? null /* arrayOf */; } /// /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).PricingCurrencyTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).PricingCurrencyTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).PricingCurrencyTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).PricingCurrencyTotal = value ?? null /* model class */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties _property; /// Properties for calculate price response [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponseProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponseProperties()); set => this._property = value; } /// /// GUID that represents reservation order that can be placed after calculating price. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).ReservationOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).ReservationOrderId = value ?? null; } + public string ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).ReservationOrderId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).ReservationOrderId = value ?? null; } /// Description of sku that is being purchased. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SkuDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).SkuDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).SkuDescription = value ?? null; } + public string SkuDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).SkuDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).SkuDescription = value ?? null; } /// Title of sku that is being purchased. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SkuTitle { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).SkuTitle; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).SkuTitle = value ?? null; } + public string SkuTitle { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).SkuTitle; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).SkuTitle = value ?? null; } /// Tax amount in pricing currency. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public double? TaxTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).TaxTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)Property).TaxTotal = value ?? default(double); } + public double? TaxTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).TaxTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)Property).TaxTotal = value ?? default(double); } /// Creates an new instance. public CalculatePriceResponse() @@ -88,14 +88,20 @@ public partial interface ICalculatePriceResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Currency and amount that customer will be charged in customer's local currency. Tax is not included.", SerializedName = @"billingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get; set; } /// Total amount in pricing currency. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Total amount in pricing currency.", SerializedName = @"grandTotal", PossibleTypes = new [] { typeof(double) })] @@ -104,6 +110,9 @@ public partial interface ICalculatePriceResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"True if billing is managed by Microsoft Partner. Used only for CSP accounts.", SerializedName = @"isBillingPartnerManaged", PossibleTypes = new [] { typeof(bool) })] @@ -112,6 +121,9 @@ public partial interface ICalculatePriceResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether or not tax is included in grand total", SerializedName = @"isTaxIncluded", PossibleTypes = new [] { typeof(bool) })] @@ -120,6 +132,9 @@ public partial interface ICalculatePriceResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Net total amount in pricing currency.", SerializedName = @"netTotal", PossibleTypes = new [] { typeof(double) })] @@ -128,26 +143,35 @@ public partial interface ICalculatePriceResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"paymentSchedule", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PaymentSchedule { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail) })] + System.Collections.Generic.List PaymentSchedule { get; set; } /// /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included.", SerializedName = @"pricingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get; set; } /// /// GUID that represents reservation order that can be placed after calculating price. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"GUID that represents reservation order that can be placed after calculating price.", SerializedName = @"reservationOrderId", PossibleTypes = new [] { typeof(string) })] @@ -156,6 +180,9 @@ public partial interface ICalculatePriceResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description of sku that is being purchased.", SerializedName = @"skuDescription", PossibleTypes = new [] { typeof(string) })] @@ -164,6 +191,9 @@ public partial interface ICalculatePriceResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Title of sku that is being purchased.", SerializedName = @"skuTitle", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +202,9 @@ public partial interface ICalculatePriceResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tax amount in pricing currency.", SerializedName = @"taxTotal", PossibleTypes = new [] { typeof(double) })] @@ -185,7 +218,7 @@ internal partial interface ICalculatePriceResponseInternal /// /// Currency and amount that customer will be charged in customer's local currency. Tax is not included. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get; set; } /// Total amount in pricing currency. double? GrandTotal { get; set; } /// True if billing is managed by Microsoft Partner. Used only for CSP accounts. @@ -195,13 +228,13 @@ internal partial interface ICalculatePriceResponseInternal /// Net total amount in pricing currency. double? NetTotal { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PaymentSchedule { get; set; } + System.Collections.Generic.List PaymentSchedule { get; set; } /// /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get; set; } /// Properties for calculate price response - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties Property { get; set; } /// /// GUID that represents reservation order that can be placed after calculating price. /// diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.json.cs index a6f372efcc39..6fe17ed298e5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,18 @@ internal CalculatePriceResponse(Microsoft.Azure.PowerShell.Cmdlets.Reservations. { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponseProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponseProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculatePriceResponse(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.PowerShell.cs similarity index 53% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.PowerShell.cs index 8485e6438d16..dfcca8a9b198 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CalculatePriceResponseProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,53 +78,53 @@ internal CalculatePriceResponseProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("BillingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesBillingCurrencyTotalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesBillingCurrencyTotalTypeConverter.ConvertFrom); } if (content.Contains("NetTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).NetTotal = (double?) content.GetValueForProperty("NetTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).NetTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).NetTotal = (double?) content.GetValueForProperty("NetTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).NetTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("TaxTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).TaxTotal = (double?) content.GetValueForProperty("TaxTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).TaxTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).TaxTotal = (double?) content.GetValueForProperty("TaxTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).TaxTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("GrandTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).GrandTotal = (double?) content.GetValueForProperty("GrandTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).GrandTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).GrandTotal = (double?) content.GetValueForProperty("GrandTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).GrandTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("IsTaxIncluded")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).IsTaxIncluded = (bool?) content.GetValueForProperty("IsTaxIncluded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).IsTaxIncluded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).IsTaxIncluded = (bool?) content.GetValueForProperty("IsTaxIncluded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).IsTaxIncluded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsBillingPartnerManaged")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).IsBillingPartnerManaged = (bool?) content.GetValueForProperty("IsBillingPartnerManaged",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).IsBillingPartnerManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).IsBillingPartnerManaged = (bool?) content.GetValueForProperty("IsBillingPartnerManaged",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).IsBillingPartnerManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); } if (content.Contains("SkuTitle")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).SkuTitle = (string) content.GetValueForProperty("SkuTitle",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).SkuTitle, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).SkuTitle = (string) content.GetValueForProperty("SkuTitle",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).SkuTitle, global::System.Convert.ToString); } if (content.Contains("SkuDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).SkuDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).SkuDescription, global::System.Convert.ToString); } if (content.Contains("PricingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesPricingCurrencyTotalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesPricingCurrencyTotalTypeConverter.ConvertFrom); } if (content.Contains("PaymentSchedule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).PaymentSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[]) content.GetValueForProperty("PaymentSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).PaymentSchedule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).PaymentSchedule = (System.Collections.Generic.List) content.GetValueForProperty("PaymentSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).PaymentSchedule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetailTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -139,75 +139,73 @@ internal CalculatePriceResponseProperties(global::System.Management.Automation.P // actually deserialize if (content.Contains("BillingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesBillingCurrencyTotalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesBillingCurrencyTotalTypeConverter.ConvertFrom); } if (content.Contains("NetTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).NetTotal = (double?) content.GetValueForProperty("NetTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).NetTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).NetTotal = (double?) content.GetValueForProperty("NetTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).NetTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("TaxTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).TaxTotal = (double?) content.GetValueForProperty("TaxTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).TaxTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).TaxTotal = (double?) content.GetValueForProperty("TaxTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).TaxTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("GrandTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).GrandTotal = (double?) content.GetValueForProperty("GrandTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).GrandTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).GrandTotal = (double?) content.GetValueForProperty("GrandTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).GrandTotal, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } if (content.Contains("IsTaxIncluded")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).IsTaxIncluded = (bool?) content.GetValueForProperty("IsTaxIncluded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).IsTaxIncluded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).IsTaxIncluded = (bool?) content.GetValueForProperty("IsTaxIncluded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).IsTaxIncluded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("IsBillingPartnerManaged")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).IsBillingPartnerManaged = (bool?) content.GetValueForProperty("IsBillingPartnerManaged",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).IsBillingPartnerManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).IsBillingPartnerManaged = (bool?) content.GetValueForProperty("IsBillingPartnerManaged",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).IsBillingPartnerManaged, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).ReservationOrderId, global::System.Convert.ToString); } if (content.Contains("SkuTitle")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).SkuTitle = (string) content.GetValueForProperty("SkuTitle",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).SkuTitle, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).SkuTitle = (string) content.GetValueForProperty("SkuTitle",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).SkuTitle, global::System.Convert.ToString); } if (content.Contains("SkuDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).SkuDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).SkuDescription, global::System.Convert.ToString); } if (content.Contains("PricingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesPricingCurrencyTotalTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesPricingCurrencyTotalTypeConverter.ConvertFrom); } if (content.Contains("PaymentSchedule")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).PaymentSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[]) content.GetValueForProperty("PaymentSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal)this).PaymentSchedule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).PaymentSchedule = (System.Collections.Generic.List) content.GetValueForProperty("PaymentSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal)this).PaymentSchedule, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetailTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CalculatePriceResponseProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CalculatePriceResponseProperties(content); } @@ -217,7 +215,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.TypeConverter.cs index 5ae06ebbf959..4377876fb282 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.cs index 5cd5526fc7cb..721ae215d9a0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.cs @@ -3,24 +3,24 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties for calculate price response public partial class CalculatePriceResponseProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal _billingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal _billingCurrencyTotal; /// /// Currency and amount that customer will be charged in customer's local currency. Tax is not included. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesBillingCurrencyTotal()); set => this._billingCurrencyTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesBillingCurrencyTotal()); set => this._billingCurrencyTotal = value; } /// Backing field for property. private double? _grandTotal; @@ -51,19 +51,19 @@ public partial class CalculatePriceResponseProperties : public double? NetTotal { get => this._netTotal; set => this._netTotal = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] _paymentSchedule; + private System.Collections.Generic.List _paymentSchedule; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PaymentSchedule { get => this._paymentSchedule; set => this._paymentSchedule = value; } + public System.Collections.Generic.List PaymentSchedule { get => this._paymentSchedule; set => this._paymentSchedule = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal _pricingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal _pricingCurrencyTotal; /// /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get => (this._pricingCurrencyTotal = this._pricingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesPricingCurrencyTotal()); set => this._pricingCurrencyTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get => (this._pricingCurrencyTotal = this._pricingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesPricingCurrencyTotal()); set => this._pricingCurrencyTotal = value; } /// Backing field for property. private string _reservationOrderId; @@ -111,14 +111,20 @@ public partial interface ICalculatePriceResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Currency and amount that customer will be charged in customer's local currency. Tax is not included.", SerializedName = @"billingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get; set; } /// Total amount in pricing currency. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Total amount in pricing currency.", SerializedName = @"grandTotal", PossibleTypes = new [] { typeof(double) })] @@ -127,6 +133,9 @@ public partial interface ICalculatePriceResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"True if billing is managed by Microsoft Partner. Used only for CSP accounts.", SerializedName = @"isBillingPartnerManaged", PossibleTypes = new [] { typeof(bool) })] @@ -135,6 +144,9 @@ public partial interface ICalculatePriceResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether or not tax is included in grand total", SerializedName = @"isTaxIncluded", PossibleTypes = new [] { typeof(bool) })] @@ -143,6 +155,9 @@ public partial interface ICalculatePriceResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Net total amount in pricing currency.", SerializedName = @"netTotal", PossibleTypes = new [] { typeof(double) })] @@ -151,26 +166,35 @@ public partial interface ICalculatePriceResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"paymentSchedule", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PaymentSchedule { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail) })] + System.Collections.Generic.List PaymentSchedule { get; set; } /// /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included.", SerializedName = @"pricingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get; set; } /// /// GUID that represents reservation order that can be placed after calculating price. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"GUID that represents reservation order that can be placed after calculating price.", SerializedName = @"reservationOrderId", PossibleTypes = new [] { typeof(string) })] @@ -179,6 +203,9 @@ public partial interface ICalculatePriceResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description of sku that is being purchased.", SerializedName = @"skuDescription", PossibleTypes = new [] { typeof(string) })] @@ -187,6 +214,9 @@ public partial interface ICalculatePriceResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Title of sku that is being purchased.", SerializedName = @"skuTitle", PossibleTypes = new [] { typeof(string) })] @@ -195,6 +225,9 @@ public partial interface ICalculatePriceResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tax amount in pricing currency.", SerializedName = @"taxTotal", PossibleTypes = new [] { typeof(double) })] @@ -208,7 +241,7 @@ internal partial interface ICalculatePriceResponsePropertiesInternal /// /// Currency and amount that customer will be charged in customer's local currency. Tax is not included. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal BillingCurrencyTotal { get; set; } /// Total amount in pricing currency. double? GrandTotal { get; set; } /// True if billing is managed by Microsoft Partner. Used only for CSP accounts. @@ -218,11 +251,11 @@ internal partial interface ICalculatePriceResponsePropertiesInternal /// Net total amount in pricing currency. double? NetTotal { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PaymentSchedule { get; set; } + System.Collections.Generic.List PaymentSchedule { get; set; } /// /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get; set; } /// /// GUID that represents reservation order that can be placed after calculating price. /// diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.json.cs similarity index 87% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.json.cs index 4947aaa12eb8..4ad5a4d9859d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponseProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponseProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,28 +65,28 @@ internal CalculatePriceResponseProperties(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesBillingCurrencyTotal.FromJson(__jsonBillingCurrencyTotal) : BillingCurrencyTotal;} - {_netTotal = If( json?.PropertyT("netTotal"), out var __jsonNetTotal) ? (double?)__jsonNetTotal : NetTotal;} - {_taxTotal = If( json?.PropertyT("taxTotal"), out var __jsonTaxTotal) ? (double?)__jsonTaxTotal : TaxTotal;} - {_grandTotal = If( json?.PropertyT("grandTotal"), out var __jsonGrandTotal) ? (double?)__jsonGrandTotal : GrandTotal;} - {_isTaxIncluded = If( json?.PropertyT("isTaxIncluded"), out var __jsonIsTaxIncluded) ? (bool?)__jsonIsTaxIncluded : IsTaxIncluded;} - {_isBillingPartnerManaged = If( json?.PropertyT("isBillingPartnerManaged"), out var __jsonIsBillingPartnerManaged) ? (bool?)__jsonIsBillingPartnerManaged : IsBillingPartnerManaged;} - {_reservationOrderId = If( json?.PropertyT("reservationOrderId"), out var __jsonReservationOrderId) ? (string)__jsonReservationOrderId : (string)ReservationOrderId;} - {_skuTitle = If( json?.PropertyT("skuTitle"), out var __jsonSkuTitle) ? (string)__jsonSkuTitle : (string)SkuTitle;} - {_skuDescription = If( json?.PropertyT("skuDescription"), out var __jsonSkuDescription) ? (string)__jsonSkuDescription : (string)SkuDescription;} - {_pricingCurrencyTotal = If( json?.PropertyT("pricingCurrencyTotal"), out var __jsonPricingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponsePropertiesPricingCurrencyTotal.FromJson(__jsonPricingCurrencyTotal) : PricingCurrencyTotal;} - {_paymentSchedule = If( json?.PropertyT("paymentSchedule"), out var __jsonPaymentSchedule) ? If( __jsonPaymentSchedule as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IPaymentDetail) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetail.FromJson(__u) )) ))() : null : PaymentSchedule;} + {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesBillingCurrencyTotal.FromJson(__jsonBillingCurrencyTotal) : _billingCurrencyTotal;} + {_netTotal = If( json?.PropertyT("netTotal"), out var __jsonNetTotal) ? (double?)__jsonNetTotal : _netTotal;} + {_taxTotal = If( json?.PropertyT("taxTotal"), out var __jsonTaxTotal) ? (double?)__jsonTaxTotal : _taxTotal;} + {_grandTotal = If( json?.PropertyT("grandTotal"), out var __jsonGrandTotal) ? (double?)__jsonGrandTotal : _grandTotal;} + {_isTaxIncluded = If( json?.PropertyT("isTaxIncluded"), out var __jsonIsTaxIncluded) ? (bool?)__jsonIsTaxIncluded : _isTaxIncluded;} + {_isBillingPartnerManaged = If( json?.PropertyT("isBillingPartnerManaged"), out var __jsonIsBillingPartnerManaged) ? (bool?)__jsonIsBillingPartnerManaged : _isBillingPartnerManaged;} + {_reservationOrderId = If( json?.PropertyT("reservationOrderId"), out var __jsonReservationOrderId) ? (string)__jsonReservationOrderId : (string)_reservationOrderId;} + {_skuTitle = If( json?.PropertyT("skuTitle"), out var __jsonSkuTitle) ? (string)__jsonSkuTitle : (string)_skuTitle;} + {_skuDescription = If( json?.PropertyT("skuDescription"), out var __jsonSkuDescription) ? (string)__jsonSkuDescription : (string)_skuDescription;} + {_pricingCurrencyTotal = If( json?.PropertyT("pricingCurrencyTotal"), out var __jsonPricingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponsePropertiesPricingCurrencyTotal.FromJson(__jsonPricingCurrencyTotal) : _pricingCurrencyTotal;} + {_paymentSchedule = If( json?.PropertyT("paymentSchedule"), out var __jsonPaymentSchedule) ? If( __jsonPaymentSchedule as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetail.FromJson(__u) )) ))() : null : _paymentSchedule;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculatePriceResponseProperties(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.PowerShell.cs similarity index 77% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.PowerShell.cs index 7180be6c0991..b00141b67ff9 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class CalculatePriceResponsePropertiesBillingCurrencyTotal partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -80,17 +80,17 @@ internal CalculatePriceResponsePropertiesBillingCurrencyTotal(global::System.Col // actually deserialize if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -105,39 +105,39 @@ internal CalculatePriceResponsePropertiesBillingCurrencyTotal(global::System.Man // actually deserialize if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CalculatePriceResponsePropertiesBillingCurrencyTotal(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CalculatePriceResponsePropertiesBillingCurrencyTotal(content); } @@ -150,7 +150,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.TypeConverter.cs index 3f6f3c906ed2..56d31e05d7b8 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.cs index d2a7359abc78..69f5741cb33f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// Currency and amount that customer will be charged in customer's local currency. Tax is not included. /// public partial class CalculatePriceResponsePropertiesBillingCurrencyTotal : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotalInternal { /// Backing field for property. @@ -47,6 +47,9 @@ public partial interface ICalculatePriceResponsePropertiesBillingCurrencyTotal : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount in pricing currency. Tax is not included.", SerializedName = @"amount", PossibleTypes = new [] { typeof(double) })] @@ -57,6 +60,9 @@ public partial interface ICalculatePriceResponsePropertiesBillingCurrencyTotal : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.json.cs index 2c0c202cc0c1..b6906f0960aa 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesBillingCurrencyTotal.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesBillingCurrencyTotal.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -68,19 +68,19 @@ internal CalculatePriceResponsePropertiesBillingCurrencyTotal(Microsoft.Azure.Po { return; } - {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)CurrencyCode;} - {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (double?)__jsonAmount : Amount;} + {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)_currencyCode;} + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (double?)__jsonAmount : _amount;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesBillingCurrencyTotal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesBillingCurrencyTotal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculatePriceResponsePropertiesBillingCurrencyTotal(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.PowerShell.cs similarity index 77% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.PowerShell.cs index 10f857e04b98..b314991fbf43 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class CalculatePriceResponsePropertiesPricingCurrencyTotal partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -80,17 +80,17 @@ internal CalculatePriceResponsePropertiesPricingCurrencyTotal(global::System.Col // actually deserialize if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -105,39 +105,39 @@ internal CalculatePriceResponsePropertiesPricingCurrencyTotal(global::System.Man // actually deserialize if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CalculatePriceResponsePropertiesPricingCurrencyTotal(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CalculatePriceResponsePropertiesPricingCurrencyTotal(content); } @@ -150,7 +150,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.TypeConverter.cs index 8103366cf570..62d83f85142b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.cs similarity index 89% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.cs index 02d16905d4a1..71a330aceb02 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. /// public partial class CalculatePriceResponsePropertiesPricingCurrencyTotal : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotalInternal { /// Backing field for property. @@ -45,6 +45,9 @@ public partial interface ICalculatePriceResponsePropertiesPricingCurrencyTotal : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"amount", PossibleTypes = new [] { typeof(float) })] @@ -55,6 +58,9 @@ public partial interface ICalculatePriceResponsePropertiesPricingCurrencyTotal : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.json.cs index c4be491cb9f2..240cf9f639b4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculatePriceResponsePropertiesPricingCurrencyTotal.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculatePriceResponsePropertiesPricingCurrencyTotal.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -68,19 +68,19 @@ internal CalculatePriceResponsePropertiesPricingCurrencyTotal(Microsoft.Azure.Po { return; } - {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)CurrencyCode;} - {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (float?)__jsonAmount : Amount;} + {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)_currencyCode;} + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (float?)__jsonAmount : _amount;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponsePropertiesPricingCurrencyTotal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponsePropertiesPricingCurrencyTotal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculatePriceResponsePropertiesPricingCurrencyTotal(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.PowerShell.cs similarity index 64% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.PowerShell.cs index d3325b35eb32..a305b9ea8f38 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CalculateRefundRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,33 +78,33 @@ internal CalculateRefundRequest(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateRefundRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("ReservationToReturn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnQuantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,55 +119,53 @@ internal CalculateRefundRequest(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateRefundRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("ReservationToReturn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnQuantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CalculateRefundRequest(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CalculateRefundRequest(content); } @@ -177,7 +175,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.TypeConverter.cs index 5a02f8e96567..7964deb98734 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.cs similarity index 67% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.cs index c96df5db354e..202c2720098e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Request containing information needed for calculating refund. public partial class CalculateRefundRequest : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal { /// Backing field for property. @@ -21,31 +21,31 @@ public partial class CalculateRefundRequest : public string Id { get => this._id; set => this._id = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateRefundRequestProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundRequestProperties()); set { {_property = value;} } } /// Internal Acessors for ReservationToReturn - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestInternal.ReservationToReturn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturn = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestInternal.ReservationToReturn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturn = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties _property; /// /// Properties needed for calculate refund including the scope and the reservation to be returned. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateRefundRequestProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundRequestProperties()); set => this._property = value; } /// Quantity to be returned. Must be greater than zero. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? ReservationToReturnQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturnQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturnQuantity = value ?? default(int); } + public int? ReservationToReturnQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturnQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturnQuantity = value ?? default(int); } /// Fully qualified identifier of the reservation being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationToReturnReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturnReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturnReservationId = value ?? null; } + public string ReservationToReturnReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturnReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)Property).ReservationToReturnReservationId = value ?? null; } /// The scope of the refund, e.g. Reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)Property).Scope = value ?? null; } /// Creates an new instance. public CalculateRefundRequest() @@ -61,6 +61,9 @@ public partial interface ICalculateRefundRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified identifier of the reservation order being returned", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +72,9 @@ public partial interface ICalculateRefundRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity to be returned. Must be greater than zero.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -77,6 +83,9 @@ public partial interface ICalculateRefundRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified identifier of the reservation being returned", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] @@ -85,6 +94,9 @@ public partial interface ICalculateRefundRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The scope of the refund, e.g. Reservation", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -100,9 +112,9 @@ internal partial interface ICalculateRefundRequestInternal /// /// Properties needed for calculate refund including the scope and the reservation to be returned. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties Property { get; set; } /// Reservation to return - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn ReservationToReturn { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn ReservationToReturn { get; set; } /// Quantity to be returned. Must be greater than zero. int? ReservationToReturnQuantity { get; set; } /// Fully qualified identifier of the reservation being returned diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.json.cs index 1fbdb12b7c92..930237dc544d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequest.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,19 +65,19 @@ internal CalculateRefundRequest(Microsoft.Azure.PowerShell.Cmdlets.Reservations. { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateRefundRequestProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundRequestProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculateRefundRequest(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.PowerShell.cs similarity index 69% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.PowerShell.cs index ad6c8daa2975..375805ec7303 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class CalculateRefundRequestProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -80,25 +80,25 @@ internal CalculateRefundRequestProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("ReservationToReturn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnQuantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -113,47 +113,45 @@ internal CalculateRefundRequestProperties(global::System.Management.Automation.P // actually deserialize if (content.Contains("ReservationToReturn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnQuantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CalculateRefundRequestProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CalculateRefundRequestProperties(content); } @@ -163,7 +161,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.TypeConverter.cs index 884e8848ca18..2c1808deed13 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.cs similarity index 72% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.cs index 67c83bebf5c8..6748099d1cbb 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -11,27 +11,27 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// Properties needed for calculate refund including the scope and the reservation to be returned. /// public partial class CalculateRefundRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal { /// Internal Acessors for ReservationToReturn - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestPropertiesInternal.ReservationToReturn { get => (this._reservationToReturn = this._reservationToReturn ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturn()); set { {_reservationToReturn = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestPropertiesInternal.ReservationToReturn { get => (this._reservationToReturn = this._reservationToReturn ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturn()); set { {_reservationToReturn = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn _reservationToReturn; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn _reservationToReturn; /// Reservation to return [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn ReservationToReturn { get => (this._reservationToReturn = this._reservationToReturn ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturn()); set => this._reservationToReturn = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn ReservationToReturn { get => (this._reservationToReturn = this._reservationToReturn ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturn()); set => this._reservationToReturn = value; } /// Quantity to be returned. Must be greater than zero. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? ReservationToReturnQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)ReservationToReturn).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)ReservationToReturn).Quantity = value ?? default(int); } + public int? ReservationToReturnQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)ReservationToReturn).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)ReservationToReturn).Quantity = value ?? default(int); } /// Fully qualified identifier of the reservation being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationToReturnReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)ReservationToReturn).ReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)ReservationToReturn).ReservationId = value ?? null; } + public string ReservationToReturnReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)ReservationToReturn).ReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)ReservationToReturn).ReservationId = value ?? null; } /// Backing field for property. private string _scope; @@ -54,6 +54,9 @@ public partial interface ICalculateRefundRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity to be returned. Must be greater than zero.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -62,6 +65,9 @@ public partial interface ICalculateRefundRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified identifier of the reservation being returned", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] @@ -70,6 +76,9 @@ public partial interface ICalculateRefundRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The scope of the refund, e.g. Reservation", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -81,7 +90,7 @@ internal partial interface ICalculateRefundRequestPropertiesInternal { /// Reservation to return - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn ReservationToReturn { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn ReservationToReturn { get; set; } /// Quantity to be returned. Must be greater than zero. int? ReservationToReturnQuantity { get; set; } /// Fully qualified identifier of the reservation being returned diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.json.cs similarity index 93% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.json.cs index a7675137b3e5..7124503822ec 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundRequestProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundRequestProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -67,19 +67,19 @@ internal CalculateRefundRequestProperties(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_reservationToReturn = If( json?.PropertyT("reservationToReturn"), out var __jsonReservationToReturn) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturn.FromJson(__jsonReservationToReturn) : ReservationToReturn;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_reservationToReturn = If( json?.PropertyT("reservationToReturn"), out var __jsonReservationToReturn) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturn.FromJson(__jsonReservationToReturn) : _reservationToReturn;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculateRefundRequestProperties(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.PowerShell.cs new file mode 100644 index 000000000000..d245010b340d --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// The response of calculate refund containing refund information of reservation + [System.ComponentModel.TypeConverter(typeof(CalculateRefundResponseTypeConverter))] + public partial class CalculateRefundResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CalculateRefundResponse(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.Reservations.Models.ICalculateRefundResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponsePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PricingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyResultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingPlan = (string) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingPlan, global::System.Convert.ToString); + } + if (content.Contains("BillingInformationCompletedTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationTotalTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ConsumedRefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("MaxRefundLimit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyErrorTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CalculateRefundResponse(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.Reservations.Models.ICalculateRefundResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponsePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PricingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyResultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingPlan = (string) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingPlan, global::System.Convert.ToString); + } + if (content.Contains("BillingInformationCompletedTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationTotalTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ConsumedRefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("MaxRefundLimit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyErrorTypeConverter.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.Reservations.Models.ICalculateRefundResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CalculateRefundResponse(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.Reservations.Models.ICalculateRefundResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CalculateRefundResponse(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.Reservations.Models.ICalculateRefundResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The response of calculate refund containing refund information of reservation + [System.ComponentModel.TypeConverter(typeof(CalculateRefundResponseTypeConverter))] + public partial interface ICalculateRefundResponse + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.TypeConverter.cs index 64ec9f89dcd0..69d1164ae556 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.cs similarity index 56% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.cs index 51b9f5653b2d..81f0dd93ae65 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.cs @@ -3,48 +3,48 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The response of calculate refund containing refund information of reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] public partial class CalculateRefundResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal { /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyProratedAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyProratedAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyProratedAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyProratedAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyProratedAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyProratedAmount = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyRemainingCommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyRemainingCommitmentAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyRemainingCommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyRemainingCommitmentAmount = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyTotalPaidAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyTotalPaidAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyTotalPaidAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyTotalPaidAmount = value ?? null /* model class */; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingInformationBillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); } + public string BillingInformationBillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingPlan = value ?? null; } /// The number of completed transactions in this reservation's payment [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? BillingInformationCompletedTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationCompletedTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationCompletedTransaction = value ?? default(int); } + public int? BillingInformationCompletedTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationCompletedTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationCompletedTransaction = value ?? default(int); } /// The number of total transactions in this reservation's payment [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? BillingInformationTotalTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationTotalTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationTotalTransaction = value ?? default(int); } + public int? BillingInformationTotalTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationTotalTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationTotalTransaction = value ?? default(int); } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingRefundAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingRefundAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingRefundAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingRefundAmount = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).ConsumedRefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).ConsumedRefundsTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).ConsumedRefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).ConsumedRefundsTotal = value ?? null /* model class */; } /// Backing field for property. private string _id; @@ -55,38 +55,38 @@ public partial class CalculateRefundResponse : /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).MaxRefundLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).MaxRefundLimit = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).MaxRefundLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).MaxRefundLimit = value ?? null /* model class */; } /// Internal Acessors for BillingInformation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal.BillingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformation = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal.BillingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformation = value; } /// Internal Acessors for PolicyResult - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal.PolicyResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyResult = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal.PolicyResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyResult = value; } /// Internal Acessors for PolicyResultProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal.PolicyResultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyResultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyResultProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal.PolicyResultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyResultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyResultProperty = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponseProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponseProperties()); set { {_property = value;} } } /// Refund Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyError = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyError = value ?? null /* arrayOf */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingRefundAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PricingRefundAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PricingRefundAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingRefundAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PricingRefundAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PricingRefundAmount = value ?? null /* model class */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties _property; /// The refund properties of reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponseProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponseProperties()); set => this._property = value; } /// Quantity to be returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).Quantity = value ?? default(int); } + public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).Quantity = value ?? default(int); } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] @@ -94,7 +94,7 @@ public partial class CalculateRefundResponse : /// Refund session identifier [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).SessionId = value ?? null; } + public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).SessionId = value ?? null; } /// Creates an new instance. public CalculateRefundResponse() @@ -110,38 +110,54 @@ public partial interface ICalculateRefundResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyProratedAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyRemainingCommitmentAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyTotalPaidAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingInformationBillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingInformationBillingPlan { get; set; } /// The number of completed transactions in this reservation's payment [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of completed transactions in this reservation's payment", SerializedName = @"completedTransactions", PossibleTypes = new [] { typeof(int) })] @@ -150,6 +166,9 @@ public partial interface ICalculateRefundResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of total transactions in this reservation's payment", SerializedName = @"totalTransactions", PossibleTypes = new [] { typeof(int) })] @@ -158,22 +177,31 @@ public partial interface ICalculateRefundResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingRefundAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"consumedRefundsTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get; set; } /// Fully qualified identifier of the reservation being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified identifier of the reservation being returned", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -182,30 +210,42 @@ public partial interface ICalculateRefundResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"maxRefundLimit", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get; set; } /// Refund Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Refund Policy errors", SerializedName = @"policyErrors", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError) })] + System.Collections.Generic.List PolicyError { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"pricingRefundAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingRefundAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingRefundAmount { get; set; } /// Quantity to be returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity to be returned", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -214,6 +254,9 @@ public partial interface ICalculateRefundResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Refund session identifier", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] @@ -225,37 +268,38 @@ internal partial interface ICalculateRefundResponseInternal { /// billing information - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation BillingInformation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation BillingInformation { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } /// Represent the billing plans. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingInformationBillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingInformationBillingPlan { get; set; } /// The number of completed transactions in this reservation's payment int? BillingInformationCompletedTransaction { get; set; } /// The number of total transactions in this reservation's payment int? BillingInformationTotalTransaction { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get; set; } /// Fully qualified identifier of the reservation being returned string Id { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get; set; } /// Refund Policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get; set; } + System.Collections.Generic.List PolicyError { get; set; } /// Refund policy result - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult PolicyResult { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult PolicyResult { get; set; } /// Refund policy result property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty PolicyResultProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty PolicyResultProperty { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingRefundAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingRefundAmount { get; set; } /// The refund properties of reservation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties Property { get; set; } /// Quantity to be returned int? Quantity { get; set; } /// Refund session identifier diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.json.cs index 491c51763170..6d4998db87b1 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CalculateRefundResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CalculateRefundResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,19 +65,19 @@ internal CalculateRefundResponse(Microsoft.Azure.PowerShell.Cmdlets.Reservations { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponseProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponseProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CalculateRefundResponse(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.PowerShell.cs similarity index 50% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.PowerShell.cs index 8d2b9519e9ab..781bd19b10d7 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class Catalog partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,65 +78,65 @@ internal Catalog(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Msrp")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Msrp = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp) content.GetValueForProperty("Msrp",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Msrp, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogMsrpTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Msrp = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp) content.GetValueForProperty("Msrp",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Msrp, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogMsrpTypeConverter.ConvertFrom); } if (content.Contains("ResourceType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).ResourceType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).ResourceType, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("BillingPlan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogBillingPlansTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogBillingPlansTypeConverter.ConvertFrom); } if (content.Contains("Terms")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Terms = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm[]) content.GetValueForProperty("Terms",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Terms, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Terms = (System.Collections.Generic.List) content.GetValueForProperty("Terms",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Terms, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Locations")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Locations = (string[]) content.GetValueForProperty("Locations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Locations, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Locations = (System.Collections.Generic.List) content.GetValueForProperty("Locations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Locations, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SkuProperties")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).SkuProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty[]) content.GetValueForProperty("SkuProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).SkuProperties, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuPropertyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).SkuProperties = (System.Collections.Generic.List) content.GetValueForProperty("SkuProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).SkuProperties, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuPropertyTypeConverter.ConvertFrom)); } if (content.Contains("Restrictions")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Restrictions = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction[]) content.GetValueForProperty("Restrictions",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Restrictions, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuRestrictionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Restrictions = (System.Collections.Generic.List) content.GetValueForProperty("Restrictions",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Restrictions, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuRestrictionTypeConverter.ConvertFrom)); } if (content.Contains("Tier")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Tier, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Tier, global::System.Convert.ToString); } if (content.Contains("Size")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Size, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Size, global::System.Convert.ToString); } if (content.Contains("Capability")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuCapabilityTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Capability = (System.Collections.Generic.List) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Capability, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuCapabilityTypeConverter.ConvertFrom)); } if (content.Contains("MsrpP1Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP1Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MsrpP1Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP1Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP1Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MsrpP1Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP1Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("MsrpP3Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP3Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MsrpP3Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP3Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP3Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MsrpP3Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP3Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("MsrpP5Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP5Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MsrpP5Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP5Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP5Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MsrpP5Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP5Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -151,85 +151,85 @@ internal Catalog(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Msrp")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Msrp = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp) content.GetValueForProperty("Msrp",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Msrp, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogMsrpTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Msrp = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp) content.GetValueForProperty("Msrp",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Msrp, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogMsrpTypeConverter.ConvertFrom); } if (content.Contains("ResourceType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).ResourceType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).ResourceType, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("BillingPlan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogBillingPlansTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogBillingPlansTypeConverter.ConvertFrom); } if (content.Contains("Terms")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Terms = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm[]) content.GetValueForProperty("Terms",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Terms, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm.CreateFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Terms = (System.Collections.Generic.List) content.GetValueForProperty("Terms",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Terms, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Locations")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Locations = (string[]) content.GetValueForProperty("Locations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Locations, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Locations = (System.Collections.Generic.List) content.GetValueForProperty("Locations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Locations, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SkuProperties")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).SkuProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty[]) content.GetValueForProperty("SkuProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).SkuProperties, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuPropertyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).SkuProperties = (System.Collections.Generic.List) content.GetValueForProperty("SkuProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).SkuProperties, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuPropertyTypeConverter.ConvertFrom)); } if (content.Contains("Restrictions")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Restrictions = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction[]) content.GetValueForProperty("Restrictions",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Restrictions, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuRestrictionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Restrictions = (System.Collections.Generic.List) content.GetValueForProperty("Restrictions",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Restrictions, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuRestrictionTypeConverter.ConvertFrom)); } if (content.Contains("Tier")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Tier, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Tier = (string) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Tier, global::System.Convert.ToString); } if (content.Contains("Size")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Size, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Size = (string) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Size, global::System.Convert.ToString); } if (content.Contains("Capability")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuCapabilityTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Capability = (System.Collections.Generic.List) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).Capability, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuCapabilityTypeConverter.ConvertFrom)); } if (content.Contains("MsrpP1Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP1Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MsrpP1Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP1Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP1Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MsrpP1Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP1Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("MsrpP3Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP3Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MsrpP3Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP3Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP3Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MsrpP3Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP3Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("MsrpP5Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP5Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MsrpP5Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal)this).MsrpP5Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP5Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MsrpP5Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal)this).MsrpP5Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Catalog(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Catalog(content); } @@ -239,7 +239,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.TypeConverter.cs index cfad482d5516..f93eead1264b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.cs similarity index 58% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.cs index b17d1bffd0c5..1620e4483c64 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.cs @@ -3,90 +3,99 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Product details of a type of resource. public partial class Catalog : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans _billingPlan; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans _billingPlan; /// The billing plan options available for this sku. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans BillingPlan { get => (this._billingPlan = this._billingPlan ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogBillingPlans()); set => this._billingPlan = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans BillingPlan { get => (this._billingPlan = this._billingPlan ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogBillingPlans()); set => this._billingPlan = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability[] _capability; + private System.Collections.Generic.List _capability; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability[] Capability { get => this._capability; } + public System.Collections.Generic.List Capability { get => this._capability; } /// Backing field for property. - private string[] _locations; + private System.Collections.Generic.List _locations; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 3)] - public string[] Locations { get => this._locations; } + public System.Collections.Generic.List Locations { get => this._locations; } /// Internal Acessors for Capability - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability[] Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal.Capability { get => this._capability; set { {_capability = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.Capability { get => this._capability; set { {_capability = value;} } } /// Internal Acessors for Locations - string[] Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal.Locations { get => this._locations; set { {_locations = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.Locations { get => this._locations; set { {_locations = value;} } } /// Internal Acessors for Msrp - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal.Msrp { get => (this._msrp = this._msrp ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogMsrp()); set { {_msrp = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.Msrp { get => (this._msrp = this._msrp ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogMsrp()); set { {_msrp = value;} } } + + /// Internal Acessors for MsrpP1Y + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.MsrpP1Y { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)Msrp).P1Y; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)Msrp).P1Y = value; } + + /// Internal Acessors for MsrpP3Y + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.MsrpP3Y { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)Msrp).P3Y; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)Msrp).P3Y = value; } + + /// Internal Acessors for MsrpP5Y + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.MsrpP5Y { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)Msrp).P5Y; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)Msrp).P5Y = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for ResourceType - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } /// Internal Acessors for Restrictions - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction[] Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal.Restrictions { get => this._restrictions; set { {_restrictions = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.Restrictions { get => this._restrictions; set { {_restrictions = value;} } } /// Internal Acessors for Size - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal.Size { get => this._size; set { {_size = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.Size { get => this._size; set { {_size = value;} } } /// Internal Acessors for SkuProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty[] Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal.SkuProperties { get => this._skuProperties; set { {_skuProperties = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.SkuProperties { get => this._skuProperties; set { {_skuProperties = value;} } } /// Internal Acessors for Terms - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm[] Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal.Terms { get => this._terms; set { {_terms = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.Terms { get => this._terms; set { {_terms = value;} } } /// Internal Acessors for Tier - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogInternal.Tier { get => this._tier; set { {_tier = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogInternal.Tier { get => this._tier; set { {_tier = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp _msrp; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp _msrp; /// Pricing information about the sku [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp Msrp { get => (this._msrp = this._msrp ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogMsrp()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp Msrp { get => (this._msrp = this._msrp ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogMsrp()); } /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MsrpP1Y { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)Msrp).P1Y; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)Msrp).P1Y = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MsrpP1Y { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)Msrp).P1Y; } /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MsrpP3Y { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)Msrp).P3Y; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)Msrp).P3Y = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MsrpP3Y { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)Msrp).P3Y; } /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MsrpP5Y { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)Msrp).P5Y; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)Msrp).P5Y = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MsrpP5Y { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)Msrp).P5Y; } /// Backing field for property. private string _name; @@ -105,11 +114,11 @@ public partial class Catalog : public string ResourceType { get => this._resourceType; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction[] _restrictions; + private System.Collections.Generic.List _restrictions; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction[] Restrictions { get => this._restrictions; } + public System.Collections.Generic.List Restrictions { get => this._restrictions; } /// Backing field for property. private string _size; @@ -120,19 +129,19 @@ public partial class Catalog : public string Size { get => this._size; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty[] _skuProperties; + private System.Collections.Generic.List _skuProperties; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty[] SkuProperties { get => this._skuProperties; } + public System.Collections.Generic.List SkuProperties { get => this._skuProperties; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm[] _terms; + private System.Collections.Generic.List _terms; /// Available reservation terms for this resource [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 1)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm[] Terms { get => this._terms; } + public System.Collections.Generic.List Terms { get => this._terms; } /// Backing field for property. private string _tier; @@ -156,54 +165,75 @@ public partial interface ICatalog : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The billing plan options available for this sku.", SerializedName = @"billingPlans", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans BillingPlan { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans BillingPlan { get; set; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"capabilities", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability[] Capability { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability) })] + System.Collections.Generic.List Capability { get; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"locations", PossibleTypes = new [] { typeof(string) })] - string[] Locations { get; } + System.Collections.Generic.List Locations { get; } /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Amount in pricing currency. Tax not included.", SerializedName = @"p1Y", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MsrpP1Y { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MsrpP1Y { get; } /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Amount in pricing currency. Tax not included.", SerializedName = @"p3Y", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MsrpP3Y { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MsrpP3Y { get; } /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Amount in pricing currency. Tax not included.", SerializedName = @"p5Y", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MsrpP5Y { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MsrpP5Y { get; } /// The name of sku [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of sku", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -212,6 +242,9 @@ public partial interface ICatalog : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of resource the sku applies to.", SerializedName = @"resourceType", PossibleTypes = new [] { typeof(string) })] @@ -220,14 +253,20 @@ public partial interface ICatalog : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"restrictions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction[] Restrictions { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction) })] + System.Collections.Generic.List Restrictions { get; } /// The size of this sku [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The size of this sku", SerializedName = @"size", PossibleTypes = new [] { typeof(string) })] @@ -236,22 +275,32 @@ public partial interface ICatalog : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"", SerializedName = @"skuProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty[] SkuProperties { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty) })] + System.Collections.Generic.List SkuProperties { get; } /// Available reservation terms for this resource [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Available reservation terms for this resource", SerializedName = @"terms", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm[] Terms { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + System.Collections.Generic.List Terms { get; } /// The tier of this sku [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tier of this sku", SerializedName = @"tier", PossibleTypes = new [] { typeof(string) })] @@ -263,31 +312,32 @@ internal partial interface ICatalogInternal { /// The billing plan options available for this sku. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans BillingPlan { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans BillingPlan { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability[] Capability { get; set; } + System.Collections.Generic.List Capability { get; set; } - string[] Locations { get; set; } + System.Collections.Generic.List Locations { get; set; } /// Pricing information about the sku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp Msrp { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp Msrp { get; set; } /// Amount in pricing currency. Tax not included. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MsrpP1Y { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MsrpP1Y { get; set; } /// Amount in pricing currency. Tax not included. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MsrpP3Y { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MsrpP3Y { get; set; } /// Amount in pricing currency. Tax not included. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MsrpP5Y { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MsrpP5Y { get; set; } /// The name of sku string Name { get; set; } /// The type of resource the sku applies to. string ResourceType { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction[] Restrictions { get; set; } + System.Collections.Generic.List Restrictions { get; set; } /// The size of this sku string Size { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty[] SkuProperties { get; set; } + System.Collections.Generic.List SkuProperties { get; set; } /// Available reservation terms for this resource - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm[] Terms { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + System.Collections.Generic.List Terms { get; set; } /// The tier of this sku string Tier { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.json.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.json.cs index ce95e45b8617..a6ba8e65d082 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Catalog.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Catalog.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,28 +65,26 @@ internal Catalog(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.Js { return; } - {_msrp = If( json?.PropertyT("msrp"), out var __jsonMsrp) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogMsrp.FromJson(__jsonMsrp) : Msrp;} - {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_billingPlan = If( json?.PropertyT("billingPlans"), out var __jsonBillingPlans) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogBillingPlans.FromJson(__jsonBillingPlans) : BillingPlan;} - {_terms = If( json?.PropertyT("terms"), out var __jsonTerms) ? If( __jsonTerms as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Support.ReservationTerm) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm)(__t.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm)""))) ))() : null : Terms;} - {_locations = If( json?.PropertyT("locations"), out var __jsonLocations) ? If( __jsonLocations as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : Locations;} - {_skuProperties = If( json?.PropertyT("skuProperties"), out var __jsonSkuProperties) ? If( __jsonSkuProperties as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuProperty.FromJson(__k) )) ))() : null : SkuProperties;} - {_restrictions = If( json?.PropertyT("restrictions"), out var __jsonRestrictions) ? If( __jsonRestrictions as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuRestriction.FromJson(__f) )) ))() : null : Restrictions;} - {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} - {_size = If( json?.PropertyT("size"), out var __jsonSize) ? (string)__jsonSize : (string)Size;} - {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? If( __jsonCapabilities as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuCapability.FromJson(__a) )) ))() : null : Capability;} + {_msrp = If( json?.PropertyT("msrp"), out var __jsonMsrp) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogMsrp.FromJson(__jsonMsrp) : _msrp;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)_resourceType;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_billingPlan = If( json?.PropertyT("billingPlans"), out var __jsonBillingPlans) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogBillingPlans.FromJson(__jsonBillingPlans) : _billingPlan;} + {_terms = If( json?.PropertyT("terms"), out var __jsonTerms) ? If( __jsonTerms as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _terms;} + {_locations = If( json?.PropertyT("locations"), out var __jsonLocations) ? If( __jsonLocations as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _locations;} + {_skuProperties = If( json?.PropertyT("skuProperties"), out var __jsonSkuProperties) ? If( __jsonSkuProperties as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuProperty.FromJson(__k) )) ))() : null : _skuProperties;} + {_restrictions = If( json?.PropertyT("restrictions"), out var __jsonRestrictions) ? If( __jsonRestrictions as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __g) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuRestriction.FromJson(__f) )) ))() : null : _restrictions;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)_tier;} + {_size = If( json?.PropertyT("size"), out var __jsonSize) ? (string)__jsonSize : (string)_size;} + {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? If( __jsonCapabilities as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __b) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuCapability.FromJson(__a) )) ))() : null : _capability;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog. + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new Catalog(json) : null; } @@ -110,20 +108,20 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._msrp ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._msrp.ToJson(null,serializationMode) : null, "msrp" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } AddIf( null != this._billingPlan ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._billingPlan.ToJson(null,serializationMode) : null, "billingPlans" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { if (null != this._terms) { @@ -135,7 +133,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ container.Add("terms",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { if (null != this._locations) { @@ -147,7 +145,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ container.Add("locations",__r); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { if (null != this._skuProperties) { @@ -159,7 +157,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ container.Add("skuProperties",__m); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { if (null != this._restrictions) { @@ -171,15 +169,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ container.Add("restrictions",__h); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._size)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._size.ToString()) : null, "size" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { if (null != this._capability) { diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.PowerShell.cs similarity index 89% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.PowerShell.cs index 7d83166f407e..89140e2dccb6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CatalogBillingPlans partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -82,7 +82,7 @@ internal CatalogBillingPlans(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -101,27 +101,27 @@ internal CatalogBillingPlans(global::System.Management.Automation.PSObject conte } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CatalogBillingPlans(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CatalogBillingPlans(content); } @@ -131,7 +131,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.TypeConverter.cs index cae665d36364..2acc6ab8766f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.cs index bd292e28cf8e..eb25f020b86b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The billing plan options available for this sku. public partial class CatalogBillingPlans : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlansInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlansInternal { /// Creates an new instance. @@ -22,7 +22,7 @@ public CatalogBillingPlans() /// The billing plan options available for this sku. public partial interface ICatalogBillingPlans : Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray> { } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.dictionary.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.dictionary.cs similarity index 54% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.dictionary.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.dictionary.cs index 764e7312fffa..1e6df257a0c6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.dictionary.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.dictionary.cs @@ -3,28 +3,28 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; public partial class CatalogBillingPlans : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray> { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + protected global::System.Collections.Generic.Dictionary> __additionalProperties = new global::System.Collections.Generic.Dictionary>(); - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + global::System.Collections.Generic.IDictionary> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray>.AdditionalProperties { get => __additionalProperties; } - int Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + int Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray>.Count { get => __additionalProperties.Count; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray>.Keys { get => __additionalProperties.Keys; } - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + global::System.Collections.Generic.IEnumerable> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray>.Values { get => __additionalProperties.Values; } - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan[] this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + public System.Collections.Generic.List this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } /// /// - public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan[] value) => __additionalProperties.Add( key, value); + public void Add(global::System.String key, System.Collections.Generic.List value) => __additionalProperties.Add( key, value); public void Clear() => __additionalProperties.Clear(); @@ -40,7 +40,7 @@ public void CopyFrom(global::System.Collections.IDictionary source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo>( property.Value)); } } } @@ -55,7 +55,7 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) { if ((null != property.Key && null != property.Value)) { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo>( property.Value)); } } } @@ -66,10 +66,10 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// /// - public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan[] value) => __additionalProperties.TryGetValue( key, out value); + public bool TryGetValue(global::System.String key, out System.Collections.Generic.List value) => __additionalProperties.TryGetValue( key, out value); /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogBillingPlans source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogBillingPlans source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.json.cs similarity index 91% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.json.cs index 7b758f84c8be..d42cf73f1567 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogBillingPlans.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogBillingPlans.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -66,18 +66,18 @@ internal CatalogBillingPlans(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Run { return; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray>)this).AdditionalProperties, null ,exclusions ); AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogBillingPlans FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogBillingPlans FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CatalogBillingPlans(json) : null; } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ { return container; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray)this).AdditionalProperties, container); + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IAssociativeArray>)this).AdditionalProperties, container); AfterToJson(ref container); return container; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.PowerShell.cs similarity index 73% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.PowerShell.cs index 70c9eabdf17a..653d7c2ba213 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CatalogMsrp partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal CatalogMsrp(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("P1Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P1Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("P1Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P1Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P1Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("P1Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P1Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("P3Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P3Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("P3Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P3Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P3Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("P3Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P3Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("P5Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P5Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("P5Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P5Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P5Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("P5Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P5Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,41 +107,41 @@ internal CatalogMsrp(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("P1Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P1Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("P1Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P1Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P1Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("P1Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P1Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("P3Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P3Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("P3Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P3Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P3Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("P3Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P3Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("P5Y")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P5Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("P5Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal)this).P5Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P5Y = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("P5Y",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal)this).P5Y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CatalogMsrp(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CatalogMsrp(content); } @@ -151,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.TypeConverter.cs index 59fbf0991ea7..cf4888894a2e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.cs similarity index 69% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.cs index a38e0288e8fa..903fde0782a0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.cs @@ -3,36 +3,36 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Pricing information about the sku public partial class CatalogMsrp : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrpInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrpInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _p1Y; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _p1Y; /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice P1Y { get => (this._p1Y = this._p1Y ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._p1Y = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice P1Y { get => (this._p1Y = this._p1Y ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._p1Y = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _p3Y; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _p3Y; /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice P3Y { get => (this._p3Y = this._p3Y ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._p3Y = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice P3Y { get => (this._p3Y = this._p3Y ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._p3Y = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _p5Y; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _p5Y; /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice P5Y { get => (this._p5Y = this._p5Y ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._p5Y = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice P5Y { get => (this._p5Y = this._p5Y ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._p5Y = value; } /// Creates an new instance. public CatalogMsrp() @@ -48,26 +48,35 @@ public partial interface ICatalogMsrp : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount in pricing currency. Tax not included.", SerializedName = @"p1Y", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice P1Y { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice P1Y { get; set; } /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount in pricing currency. Tax not included.", SerializedName = @"p3Y", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice P3Y { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice P3Y { get; set; } /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount in pricing currency. Tax not included.", SerializedName = @"p5Y", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice P5Y { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice P5Y { get; set; } } /// Pricing information about the sku @@ -75,11 +84,11 @@ internal partial interface ICatalogMsrpInternal { /// Amount in pricing currency. Tax not included. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice P1Y { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice P1Y { get; set; } /// Amount in pricing currency. Tax not included. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice P3Y { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice P3Y { get; set; } /// Amount in pricing currency. Tax not included. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice P5Y { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice P5Y { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.json.cs index 937bb19d53cf..b584055185fd 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogMsrp.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogMsrp.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,20 +65,20 @@ internal CatalogMsrp(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Jso { return; } - {_p1Y = If( json?.PropertyT("p1Y"), out var __jsonP1Y) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonP1Y) : P1Y;} - {_p3Y = If( json?.PropertyT("p3Y"), out var __jsonP3Y) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonP3Y) : P3Y;} - {_p5Y = If( json?.PropertyT("p5Y"), out var __jsonP5Y) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonP5Y) : P5Y;} + {_p1Y = If( json?.PropertyT("p1Y"), out var __jsonP1Y) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonP1Y) : _p1Y;} + {_p3Y = If( json?.PropertyT("p3Y"), out var __jsonP3Y) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonP3Y) : _p3Y;} + {_p5Y = If( json?.PropertyT("p5Y"), out var __jsonP5Y) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonP5Y) : _p5Y;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogMsrp FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogMsrp FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CatalogMsrp(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.PowerShell.cs similarity index 74% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.PowerShell.cs index 029aed949785..a945d6c98493 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CatalogsResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal CatalogsResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("TotalItem")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).TotalItem = (long?) content.GetValueForProperty("TotalItem",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).TotalItem, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).TotalItem = (long?) content.GetValueForProperty("TotalItem",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).TotalItem, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,41 +107,41 @@ internal CatalogsResult(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("TotalItem")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).TotalItem = (long?) content.GetValueForProperty("TotalItem",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal)this).TotalItem, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).TotalItem = (long?) content.GetValueForProperty("TotalItem",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal)this).TotalItem, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CatalogsResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CatalogsResult(content); } @@ -151,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.TypeConverter.cs index 73b7a09b689f..82905411851b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.cs similarity index 74% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.cs index 4cc8e622ba39..d7460948b12d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The list of catalogs and pagination information. public partial class CatalogsResult : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog[] Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -34,11 +34,11 @@ public partial class CatalogsResult : public long? TotalItem { get => this._totalItem; set => this._totalItem = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog[] _value; + private System.Collections.Generic.List _value; /// The list of catalogs. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public CatalogsResult() @@ -54,6 +54,9 @@ public partial interface ICatalogsResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The link (url) to the next page of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -62,6 +65,9 @@ public partial interface ICatalogsResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The total amount of catalog items.", SerializedName = @"totalItems", PossibleTypes = new [] { typeof(long) })] @@ -70,10 +76,13 @@ public partial interface ICatalogsResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of catalogs.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog) })] + System.Collections.Generic.List Value { get; } } /// The list of catalogs and pagination information. @@ -85,7 +94,7 @@ internal partial interface ICatalogsResultInternal /// The total amount of catalog items. long? TotalItem { get; set; } /// The list of catalogs. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.json.cs similarity index 89% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.json.cs index 14ae4aa7dc6c..81b27c8473cf 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/CatalogsResult.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/CatalogsResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,20 +65,20 @@ internal CatalogsResult(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.ICatalog) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Catalog.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_totalItem = If( json?.PropertyT("totalItems"), out var __jsonTotalItems) ? (long?)__jsonTotalItems : TotalItem;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Catalog.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} + {_totalItem = If( json?.PropertyT("totalItems"), out var __jsonTotalItems) ? (long?)__jsonTotalItems : _totalItem;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new CatalogsResult(json) : null; } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -114,7 +114,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.PowerShell.cs similarity index 83% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.PowerShell.cs index 28724b203530..86c0df6dca7f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ChangeDirectoryRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,13 +78,13 @@ internal ChangeDirectoryRequest(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("DestinationTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequestInternal)this).DestinationTenantId = (string) content.GetValueForProperty("DestinationTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequestInternal)this).DestinationTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequestInternal)this).DestinationTenantId = (string) content.GetValueForProperty("DestinationTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequestInternal)this).DestinationTenantId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -99,35 +99,33 @@ internal ChangeDirectoryRequest(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("DestinationTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequestInternal)this).DestinationTenantId = (string) content.GetValueForProperty("DestinationTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequestInternal)this).DestinationTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequestInternal)this).DestinationTenantId = (string) content.GetValueForProperty("DestinationTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequestInternal)this).DestinationTenantId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ChangeDirectoryRequest(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ChangeDirectoryRequest(content); } @@ -137,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.TypeConverter.cs index 6e14866bba60..81d7e626963f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.cs similarity index 89% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.cs index 415227e402ad..88d26fe0758b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Request body for change directory of a reservation. public partial class ChangeDirectoryRequest : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequestInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface IChangeDirectoryRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant id GUID that reservation order is to be transferred to", SerializedName = @"destinationTenantId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.json.cs index 9417fe17eefe..7f0d6ea5eb97 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryRequest.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ChangeDirectoryRequest(Microsoft.Azure.PowerShell.Cmdlets.Reservations. { return; } - {_destinationTenantId = If( json?.PropertyT("destinationTenantId"), out var __jsonDestinationTenantId) ? (string)__jsonDestinationTenantId : (string)DestinationTenantId;} + {_destinationTenantId = If( json?.PropertyT("destinationTenantId"), out var __jsonDestinationTenantId) ? (string)__jsonDestinationTenantId : (string)_destinationTenantId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ChangeDirectoryRequest(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.PowerShell.cs similarity index 62% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.PowerShell.cs index 6a4a38b0ccd7..07079c1c0693 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ChangeDirectoryResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,33 +78,33 @@ internal ChangeDirectoryResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ReservationOrder")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrder = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult) content.GetValueForProperty("ReservationOrder",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrder, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResultTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrder = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult) content.GetValueForProperty("ReservationOrder",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrder, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResultTypeConverter.ConvertFrom); } if (content.Contains("Reservation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).Reservation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult[]) content.GetValueForProperty("Reservation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).Reservation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResultTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).Reservation = (System.Collections.Generic.List) content.GetValueForProperty("Reservation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).Reservation, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResultTypeConverter.ConvertFrom)); } if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderId, global::System.Convert.ToString); } if (content.Contains("ReservationOrderName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderName, global::System.Convert.ToString); } if (content.Contains("ReservationOrderIsSucceeded")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderIsSucceeded = (bool?) content.GetValueForProperty("ReservationOrderIsSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderIsSucceeded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderIsSucceeded = (bool?) content.GetValueForProperty("ReservationOrderIsSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderIsSucceeded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReservationOrderError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderError = (string) content.GetValueForProperty("ReservationOrderError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderError, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderError = (string) content.GetValueForProperty("ReservationOrderError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderError, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -119,55 +119,53 @@ internal ChangeDirectoryResponse(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("ReservationOrder")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrder = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult) content.GetValueForProperty("ReservationOrder",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrder, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResultTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrder = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult) content.GetValueForProperty("ReservationOrder",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrder, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResultTypeConverter.ConvertFrom); } if (content.Contains("Reservation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).Reservation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult[]) content.GetValueForProperty("Reservation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).Reservation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResultTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).Reservation = (System.Collections.Generic.List) content.GetValueForProperty("Reservation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).Reservation, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResultTypeConverter.ConvertFrom)); } if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderId, global::System.Convert.ToString); } if (content.Contains("ReservationOrderName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderName = (string) content.GetValueForProperty("ReservationOrderName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderName, global::System.Convert.ToString); } if (content.Contains("ReservationOrderIsSucceeded")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderIsSucceeded = (bool?) content.GetValueForProperty("ReservationOrderIsSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderIsSucceeded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderIsSucceeded = (bool?) content.GetValueForProperty("ReservationOrderIsSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderIsSucceeded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("ReservationOrderError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderError = (string) content.GetValueForProperty("ReservationOrderError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal)this).ReservationOrderError, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderError = (string) content.GetValueForProperty("ReservationOrderError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal)this).ReservationOrderError, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ChangeDirectoryResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ChangeDirectoryResponse(content); } @@ -177,7 +175,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.TypeConverter.cs index 86e317cef66b..ba3db4b8f024 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.cs similarity index 65% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.cs index 410e16ab0b9a..5f3e69f2c3d0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.cs @@ -3,49 +3,49 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Change directory response public partial class ChangeDirectoryResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal { /// Internal Acessors for ReservationOrder - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponseInternal.ReservationOrder { get => (this._reservationOrder = this._reservationOrder ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResult()); set { {_reservationOrder = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponseInternal.ReservationOrder { get => (this._reservationOrder = this._reservationOrder ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResult()); set { {_reservationOrder = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult[] _reservation; + private System.Collections.Generic.List _reservation; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult[] Reservation { get => this._reservation; set => this._reservation = value; } + public System.Collections.Generic.List Reservation { get => this._reservation; set => this._reservation = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult _reservationOrder; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult _reservationOrder; /// Change directory result for reservation order or reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult ReservationOrder { get => (this._reservationOrder = this._reservationOrder ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResult()); set => this._reservationOrder = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult ReservationOrder { get => (this._reservationOrder = this._reservationOrder ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResult()); set => this._reservationOrder = value; } /// Error reason if operation failed. Null otherwise [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationOrderError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)ReservationOrder).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)ReservationOrder).Error = value ?? null; } + public string ReservationOrderError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)ReservationOrder).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)ReservationOrder).Error = value ?? null; } /// Identifier of the reservation order or reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)ReservationOrder).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)ReservationOrder).Id = value ?? null; } + public string ReservationOrderId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)ReservationOrder).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)ReservationOrder).Id = value ?? null; } /// /// True if change directory operation succeeded on this reservation order or reservation /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public bool? ReservationOrderIsSucceeded { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)ReservationOrder).IsSucceeded; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)ReservationOrder).IsSucceeded = value ?? default(bool); } + public bool? ReservationOrderIsSucceeded { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)ReservationOrder).IsSucceeded; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)ReservationOrder).IsSucceeded = value ?? default(bool); } /// Name of the reservation order or reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)ReservationOrder).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)ReservationOrder).Name = value ?? null; } + public string ReservationOrderName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)ReservationOrder).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)ReservationOrder).Name = value ?? null; } /// Creates an new instance. public ChangeDirectoryResponse() @@ -60,14 +60,20 @@ public partial interface IChangeDirectoryResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"reservations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult[] Reservation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult) })] + System.Collections.Generic.List Reservation { get; set; } /// Error reason if operation failed. Null otherwise [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Error reason if operation failed. Null otherwise", SerializedName = @"error", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +82,9 @@ public partial interface IChangeDirectoryResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Identifier of the reservation order or reservation", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -86,6 +95,9 @@ public partial interface IChangeDirectoryResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"True if change directory operation succeeded on this reservation order or reservation", SerializedName = @"isSucceeded", PossibleTypes = new [] { typeof(bool) })] @@ -94,6 +106,9 @@ public partial interface IChangeDirectoryResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the reservation order or reservation", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -104,9 +119,9 @@ public partial interface IChangeDirectoryResponse : internal partial interface IChangeDirectoryResponseInternal { - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult[] Reservation { get; set; } + System.Collections.Generic.List Reservation { get; set; } /// Change directory result for reservation order or reservation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult ReservationOrder { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult ReservationOrder { get; set; } /// Error reason if operation failed. Null otherwise string ReservationOrderError { get; set; } /// Identifier of the reservation order or reservation diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.json.cs similarity index 89% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.json.cs index 532827133681..7c8744e3b8d2 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ChangeDirectoryResponse(Microsoft.Azure.PowerShell.Cmdlets.Reservations { return; } - {_reservationOrder = If( json?.PropertyT("reservationOrder"), out var __jsonReservationOrder) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResult.FromJson(__jsonReservationOrder) : ReservationOrder;} - {_reservation = If( json?.PropertyT("reservations"), out var __jsonReservations) ? If( __jsonReservations as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IChangeDirectoryResult) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResult.FromJson(__u) )) ))() : null : Reservation;} + {_reservationOrder = If( json?.PropertyT("reservationOrder"), out var __jsonReservationOrder) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResult.FromJson(__jsonReservationOrder) : _reservationOrder;} + {_reservation = If( json?.PropertyT("reservations"), out var __jsonReservations) ? If( __jsonReservations as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResult.FromJson(__u) )) ))() : null : _reservation;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ChangeDirectoryResponse(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.PowerShell.cs similarity index 74% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.PowerShell.cs index a36047aae7de..280f3304f719 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ChangeDirectoryResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,25 +78,25 @@ internal ChangeDirectoryResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsSucceeded")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).IsSucceeded = (bool?) content.GetValueForProperty("IsSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).IsSucceeded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).IsSucceeded = (bool?) content.GetValueForProperty("IsSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).IsSucceeded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Error = (string) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Error, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Error = (string) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Error, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -111,45 +111,45 @@ internal ChangeDirectoryResult(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsSucceeded")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).IsSucceeded = (bool?) content.GetValueForProperty("IsSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).IsSucceeded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).IsSucceeded = (bool?) content.GetValueForProperty("IsSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).IsSucceeded, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Error = (string) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal)this).Error, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Error = (string) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal)this).Error, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ChangeDirectoryResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ChangeDirectoryResult(content); } @@ -159,7 +159,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.TypeConverter.cs index 2a488d1637eb..43099a9bdd2b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.cs similarity index 91% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.cs index ef8000fb4856..104fc1a214b2 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Change directory result for reservation order or reservation public partial class ChangeDirectoryResult : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResultInternal { /// Backing field for property. @@ -57,6 +57,9 @@ public partial interface IChangeDirectoryResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Error reason if operation failed. Null otherwise", SerializedName = @"error", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IChangeDirectoryResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Identifier of the reservation order or reservation", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +81,9 @@ public partial interface IChangeDirectoryResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"True if change directory operation succeeded on this reservation order or reservation", SerializedName = @"isSucceeded", PossibleTypes = new [] { typeof(bool) })] @@ -83,6 +92,9 @@ public partial interface IChangeDirectoryResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the reservation order or reservation", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.json.cs index ae7314e349da..c31e24ea013e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ChangeDirectoryResult.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ChangeDirectoryResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ChangeDirectoryResult(Microsoft.Azure.PowerShell.Cmdlets.Reservations.R { 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;} - {_isSucceeded = If( json?.PropertyT("isSucceeded"), out var __jsonIsSucceeded) ? (bool?)__jsonIsSucceeded : IsSucceeded;} - {_error = If( json?.PropertyT("error"), out var __jsonError) ? (string)__jsonError : (string)Error;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_isSucceeded = If( json?.PropertyT("isSucceeded"), out var __jsonIsSucceeded) ? (bool?)__jsonIsSucceeded : _isSucceeded;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? (string)__jsonError : (string)_error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ChangeDirectoryResult(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.PowerShell.cs similarity index 76% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.PowerShell.cs index 922d2d13f009..bbe47720cf4b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class Commitment partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal Commitment(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Grain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitmentInternal)this).Grain = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain?) content.GetValueForProperty("Grain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitmentInternal)this).Grain, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitmentInternal)this).Grain = (string) content.GetValueForProperty("Grain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitmentInternal)this).Grain, global::System.Convert.ToString); } if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -107,41 +107,41 @@ internal Commitment(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Grain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitmentInternal)this).Grain = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain?) content.GetValueForProperty("Grain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitmentInternal)this).Grain, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitmentInternal)this).Grain = (string) content.GetValueForProperty("Grain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitmentInternal)this).Grain, global::System.Convert.ToString); } if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Commitment(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Commitment(content); } @@ -151,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.TypeConverter.cs index 4e6022dd8998..8d99c14adbc9 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.cs similarity index 66% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.cs index 1b864a9a6d5e..5547d704e218 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.cs @@ -3,37 +3,36 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Commitment towards the benefit. public partial class Commitment : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitmentInternal, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitmentInternal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice __price = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice __price = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price(); [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public double? Amount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)__price).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)__price).Amount = value ?? default(double); } + public double? Amount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)__price).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)__price).Amount = value ?? default(double); } /// /// The ISO 4217 3-letter currency code for the currency used by this purchase record. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public string CurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)__price).CurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)__price).CurrencyCode = value ?? null; } + public string CurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)__price).CurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)__price).CurrencyCode = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? _grain; + private string _grain; /// Commitment grain. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? Grain { get => this._grain; set => this._grain = value; } + public string Grain { get => this._grain; set => this._grain = value; } /// Creates an new instance. public Commitment() @@ -56,24 +55,29 @@ public Commitment() /// Commitment towards the benefit. public partial interface ICommitment : Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice { /// Commitment grain. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Commitment grain.", SerializedName = @"grain", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? Grain { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Hourly")] + string Grain { get; set; } } /// Commitment towards the benefit. internal partial interface ICommitmentInternal : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal { /// Commitment grain. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? Grain { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Hourly")] + string Grain { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.json.cs index a516da5b3c9b..960ab5250ebd 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Commitment.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Commitment.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,19 +65,19 @@ internal Commitment(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json { return; } - __price = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price(json); - {_grain = If( json?.PropertyT("grain"), out var __jsonGrain) ? (string)__jsonGrain : (string)Grain;} + __price = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price(json); + {_grain = If( json?.PropertyT("grain"), out var __jsonGrain) ? (string)__jsonGrain : (string)_grain;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new Commitment(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Error.PowerShell.cs similarity index 75% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Error.PowerShell.cs index afc1ab069b37..9f04b7147044 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Error.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class Error partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Error(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Error(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,21 +104,21 @@ internal Error(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedErrorInfoTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedErrorInfoTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Code = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Code, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,15 +133,15 @@ internal Error(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedErrorInfoTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Error1 = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo) content.GetValueForProperty("Error1",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Error1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedErrorInfoTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Code = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Code, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,7 +151,7 @@ internal Error(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Error.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Error.TypeConverter.cs index 97436e314fbe..7aca61f6df5b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Error.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Error.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Error.cs new file mode 100644 index 000000000000..b5bc2b7095b6 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Error.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + + /// Error information + public partial class Error : + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal + { + + /// + /// Error code describing the reason that service is not able to process the incoming request + /// + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)Error1).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)Error1).Code = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo _error1; + + /// Extended error information including error code and error message + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedErrorInfo()); set => this._error1 = value; } + + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)Error1).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)Error1).Message = value ?? null; } + + /// Internal Acessors for Error1 + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorInternal.Error1 { get => (this._error1 = this._error1 ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedErrorInfo()); set { {_error1 = value;} } } + + /// Creates an new instance. + public Error() + { + + } + } + /// Error information + public partial interface IError : + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable + { + /// + /// Error code describing the reason that service is not able to process the incoming request + /// + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Error code describing the reason that service is not able to process the incoming request", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("NotSpecified", "InternalServerError", "ServerTimeout", "AuthorizationFailed", "BadRequest", "ClientCertificateThumbprintNotSet", "InvalidRequestContent", "OperationFailed", "HttpMethodNotSupported", "InvalidRequestUri", "MissingTenantId", "InvalidTenantId", "InvalidReservationOrderId", "InvalidReservationId", "ReservationIdNotInReservationOrder", "ReservationOrderNotFound", "InvalidSubscriptionId", "InvalidAccessToken", "InvalidLocationId", "UnauthenticatedRequestsThrottled", "InvalidHealthCheckType", "Forbidden", "BillingScopeIdCannotBeChanged", "AppliedScopesNotAssociatedWithCommerceAccount", "PatchValuesSameAsExisting", "RoleAssignmentCreationFailed", "ReservationOrderCreationFailed", "ReservationOrderNotEnabled", "CapacityUpdateScopesFailed", "UnsupportedReservationTerm", "ReservationOrderIdAlreadyExists", "RiskCheckFailed", "CreateQuoteFailed", "ActivateQuoteFailed", "NonsupportedAccountId", "PaymentInstrumentNotFound", "MissingAppliedScopesForSingle", "NoValidReservationsToReRate", "ReRateOnlyAllowedForEA", "OperationCannotBePerformedInCurrentState", "InvalidSingleAppliedScopesCount", "InvalidFulfillmentRequestParameters", "NotSupportedCountry", "InvalidRefundQuantity", "PurchaseError", "BillingCustomerInputError", "BillingPaymentInstrumentSoftError", "BillingPaymentInstrumentHardError", "BillingTransientError", "BillingError", "FulfillmentConfigurationError", "FulfillmentOutOfStockError", "FulfillmentTransientError", "FulfillmentError", "CalculatePriceFailed", "AppliedScopesSameAsExisting", "SelfServiceRefundNotSupported", "RefundLimitExceeded")] + string Code { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// Error information + internal partial interface IErrorInternal + + { + /// + /// Error code describing the reason that service is not able to process the incoming request + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("NotSpecified", "InternalServerError", "ServerTimeout", "AuthorizationFailed", "BadRequest", "ClientCertificateThumbprintNotSet", "InvalidRequestContent", "OperationFailed", "HttpMethodNotSupported", "InvalidRequestUri", "MissingTenantId", "InvalidTenantId", "InvalidReservationOrderId", "InvalidReservationId", "ReservationIdNotInReservationOrder", "ReservationOrderNotFound", "InvalidSubscriptionId", "InvalidAccessToken", "InvalidLocationId", "UnauthenticatedRequestsThrottled", "InvalidHealthCheckType", "Forbidden", "BillingScopeIdCannotBeChanged", "AppliedScopesNotAssociatedWithCommerceAccount", "PatchValuesSameAsExisting", "RoleAssignmentCreationFailed", "ReservationOrderCreationFailed", "ReservationOrderNotEnabled", "CapacityUpdateScopesFailed", "UnsupportedReservationTerm", "ReservationOrderIdAlreadyExists", "RiskCheckFailed", "CreateQuoteFailed", "ActivateQuoteFailed", "NonsupportedAccountId", "PaymentInstrumentNotFound", "MissingAppliedScopesForSingle", "NoValidReservationsToReRate", "ReRateOnlyAllowedForEA", "OperationCannotBePerformedInCurrentState", "InvalidSingleAppliedScopesCount", "InvalidFulfillmentRequestParameters", "NotSupportedCountry", "InvalidRefundQuantity", "PurchaseError", "BillingCustomerInputError", "BillingPaymentInstrumentSoftError", "BillingPaymentInstrumentHardError", "BillingTransientError", "BillingError", "FulfillmentConfigurationError", "FulfillmentOutOfStockError", "FulfillmentTransientError", "FulfillmentError", "CalculatePriceFailed", "AppliedScopesSameAsExisting", "SelfServiceRefundNotSupported", "RefundLimitExceeded")] + string Code { get; set; } + /// Extended error information including error code and error message + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo Error1 { get; set; } + + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Error.json.cs similarity index 93% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Error.json.cs index b0c141826f21..c47d5f651bc0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Error.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Error.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,16 @@ internal Error(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.Json { return; } - {_error1 = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedErrorInfo.FromJson(__jsonError) : Error1;} + {_error1 = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedErrorInfo.FromJson(__jsonError) : _error1;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError. + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new Error(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.PowerShell.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.PowerShell.cs index dba32ce3cf08..3106000bad61 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ErrorDetails partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorDetails(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorDetails(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,21 +104,21 @@ internal ErrorDetails(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Target, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,15 +133,15 @@ internal ErrorDetails(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)this).Target, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,7 +151,7 @@ internal ErrorDetails(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.TypeConverter.cs index 4454d8332291..cce85ec5ea86 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.cs similarity index 85% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.cs index 66cb68e8ad57..df6bcb4e2c07 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The details of the error. public partial class ErrorDetails : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal { /// Backing field for property. @@ -28,13 +28,13 @@ public partial class ErrorDetails : public string Message { get => this._message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal.Message { get => this._message; set { {_message = value;} } } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal.Target { get => this._target; set { {_target = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal.Target { get => this._target; set { {_target = value;} } } /// Backing field for property. private string _target; @@ -57,6 +57,9 @@ public partial interface IErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +79,9 @@ public partial interface IErrorDetails : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The target of the particular error.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.json.cs index 666fad43cf04..57ec9d9decbf 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorDetails.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorDetails.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,20 +65,20 @@ internal ErrorDetails(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Js { 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;} - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ErrorDetails(json) : null; } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 74% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index f9396e732221..e167b63dce73 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -66,33 +66,33 @@ public partial class ErrorResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponse(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,25 +107,25 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ErrorDetailsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ErrorDetailsTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -140,19 +140,19 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ErrorDetailsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ErrorDetailsTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -162,7 +162,7 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index d955567d4f7a..e0799b1ecf31 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.cs similarity index 68% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.cs index 61b3cb2d76ee..ead7682ae349 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -12,40 +12,40 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// message. /// public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal { /// Error code. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)Error).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails _error; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails _error; /// The details of the error. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ErrorDetails()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ErrorDetails()); set => this._error = value; } /// Error message indicating why the operation failed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)Error).Code = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ErrorDetails()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ErrorDetails()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)Error).Message = value; } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)Error).Target = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)Error).Target = value; } /// The target of the particular error. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetailsInternal)Error).Target; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetailsInternal)Error).Target; } /// Creates an new instance. public ErrorResponse() @@ -62,6 +62,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -70,6 +73,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -78,6 +84,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The target of the particular error.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -92,7 +101,7 @@ internal partial interface IErrorResponseInternal /// Error code. string Code { get; set; } /// The details of the error. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorDetails Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorDetails Error { get; set; } /// Error message indicating why the operation failed. string Message { get; set; } /// The target of the particular error. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.json.cs index e4a36cf63d95..be47135dd19d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ErrorResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -68,18 +68,18 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.J { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ErrorDetails.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ErrorDetails.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.PowerShell.cs new file mode 100644 index 000000000000..40ffbe018ff6 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.PowerShell.cs @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// Exchange operation result + [System.ComponentModel.TypeConverter(typeof(ExchangeOperationResultResponseTypeConverter))] + public partial class ExchangeOperationResultResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExchangeOperationResultResponse(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.Reservations.Models.IExchangeOperationResultResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExchangeOperationResultResponse(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExchangeOperationResultResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Properties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeResponsePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("NetPayable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("RefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasesTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ReservationsToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("SavingsPlansToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ReservationsToExchange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnForExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("PolicyResultPolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PolicyResultPolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExchangeOperationResultResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Properties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeResponsePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultErrorTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorsTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("NetPayable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("RefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasesTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ReservationsToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("SavingsPlansToPurchase")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ReservationsToExchange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnForExchangeTypeConverter.ConvertFrom)); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("PolicyResultPolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PolicyResultPolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Exchange operation result + [System.ComponentModel.TypeConverter(typeof(ExchangeOperationResultResponseTypeConverter))] + public partial interface IExchangeOperationResultResponse + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.TypeConverter.cs index 28c2f4c75833..b4a181b99c61 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.cs similarity index 62% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.cs index e600707862bf..0fff7d74a8c8 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Exchange operation result public partial class ExchangeOperationResultResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal { /// @@ -19,15 +19,15 @@ public partial class ExchangeOperationResultResponse : /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)Error).Code = value ?? null; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)Error).Code = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError _error; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError _error; /// Required if status == failed or status == canceled. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultError()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultError()); set => this._error = value; } /// Backing field for property. private string _id; @@ -43,16 +43,16 @@ public partial class ExchangeOperationResultResponse : /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)Error).Message = value ?? null; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)Error).Message = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultError()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultError()); set { {_error = value;} } } /// Internal Acessors for PolicyResult - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal.PolicyResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).PolicyResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).PolicyResult = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal.PolicyResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).PolicyResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).PolicyResult = value; } /// Internal Acessors for Properties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponseInternal.Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeResponseProperties()); set { {_properties = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponseInternal.Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeResponseProperties()); set { {_properties = value;} } } /// Backing field for property. private string _name; @@ -67,40 +67,40 @@ public partial class ExchangeOperationResultResponse : /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).NetPayable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).NetPayable = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).NetPayable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).NetPayable = value ?? null /* model class */; } /// Exchange Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).PolicyResultPolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).PolicyResultPolicyError = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PolicyResultPolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).PolicyResultPolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).PolicyResultPolicyError = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties _properties; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties _properties; /// Exchange response properties [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeResponseProperties()); set => this._properties = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeResponseProperties()); set => this._properties = value; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).PurchasesTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).PurchasesTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).PurchasesTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).PurchasesTotal = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).RefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).RefundsTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).RefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).RefundsTotal = value ?? null /* model class */; } /// Details of the reservations being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[] ReservationsToExchange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).ReservationsToExchange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).ReservationsToExchange = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ReservationsToExchange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).ReservationsToExchange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).ReservationsToExchange = value ?? null /* arrayOf */; } /// Details of the reservations being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[] ReservationsToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).ReservationsToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).ReservationsToPurchase = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ReservationsToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).ReservationsToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).ReservationsToPurchase = value ?? null /* arrayOf */; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] @@ -110,20 +110,20 @@ public partial class ExchangeOperationResultResponse : /// Details of the savings plans being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[] SavingsPlansToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).SavingsPlansToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).SavingsPlansToPurchase = value ?? null /* arrayOf */; } + public System.Collections.Generic.List SavingsPlansToPurchase { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).SavingsPlansToPurchase; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).SavingsPlansToPurchase = value ?? null /* arrayOf */; } /// Exchange session identifier [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 0)] - public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)Properties).SessionId = value ?? null; } + public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)Properties).SessionId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus? _status; + private string _status; /// Status of the operation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 1)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Creates an new instance. public ExchangeOperationResultResponse() @@ -142,6 +142,9 @@ public partial interface IExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Required if status == failed or status == cancelled. If status == failed, provide an invariant error code used for error troubleshooting, aggregation, and analysis.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +153,9 @@ public partial interface IExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"It should match what is used to GET the operation result.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -161,6 +167,9 @@ public partial interface IExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Required if status == failed. Localized. If status == failed, provide an actionable error message indicating what error occurred, and what the user can do to address the issue.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -171,6 +180,9 @@ public partial interface IExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"It must match the last segment of the id field, and will typically be a GUID / system generated value.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -179,62 +191,86 @@ public partial interface IExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"netPayable", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get; set; } /// Exchange Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Exchange Policy errors", SerializedName = @"policyErrors", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError) })] + System.Collections.Generic.List PolicyResultPolicyError { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"purchasesTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"refundsTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get; set; } /// Details of the reservations being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the reservations being returned", SerializedName = @"reservationsToExchange", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[] ReservationsToExchange { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange) })] + System.Collections.Generic.List ReservationsToExchange { get; set; } /// Details of the reservations being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the reservations being purchased", SerializedName = @"reservationsToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[] ReservationsToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange) })] + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// Details of the savings plans being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the savings plans being purchased", SerializedName = @"savingsPlansToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[] SavingsPlansToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchange) })] + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } /// Exchange session identifier [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Exchange session identifier", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] @@ -243,10 +279,14 @@ public partial interface IExchangeOperationResultResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Status of the operation.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "PendingRefunds", "PendingPurchases")] + string Status { get; set; } } /// Exchange operation result @@ -259,7 +299,7 @@ internal partial interface IExchangeOperationResultResponseInternal /// string Code { get; set; } /// Required if status == failed or status == canceled. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError Error { get; set; } /// It should match what is used to GET the operation result. string Id { get; set; } /// @@ -272,27 +312,28 @@ internal partial interface IExchangeOperationResultResponseInternal /// string Name { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get; set; } /// Exchange policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors PolicyResult { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors PolicyResult { get; set; } /// Exchange Policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get; set; } + System.Collections.Generic.List PolicyResultPolicyError { get; set; } /// Exchange response properties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties Properties { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties Properties { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get; set; } /// Details of the reservations being returned - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[] ReservationsToExchange { get; set; } + System.Collections.Generic.List ReservationsToExchange { get; set; } /// Details of the reservations being purchased - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[] ReservationsToPurchase { get; set; } + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// Details of the savings plans being purchased - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[] SavingsPlansToPurchase { get; set; } + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } /// Exchange session identifier string SessionId { get; set; } /// Status of the operation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "PendingRefunds", "PendingPurchases")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.json.cs index 8301f6ca9fda..258c76d4c3ae 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeOperationResultResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeOperationResultResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ExchangeOperationResultResponse(Microsoft.Azure.PowerShell.Cmdlets.Rese { return; } - {_properties = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeResponseProperties.FromJson(__jsonProperties) : Properties;} - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResultError.FromJson(__jsonError) : Error;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_properties = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeResponseProperties.FromJson(__jsonProperties) : _properties;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResultError.FromJson(__jsonError) : _error;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ExchangeOperationResultResponse(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.PowerShell.cs similarity index 81% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.PowerShell.cs index cc28e1493f03..d105b1cb16a1 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ExchangePolicyError partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExchangePolicyError(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExchangePolicyError(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,17 +104,17 @@ internal ExchangePolicyError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -129,11 +129,11 @@ internal ExchangePolicyError(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,7 +143,7 @@ internal ExchangePolicyError(global::System.Management.Automation.PSObject conte /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.TypeConverter.cs index 357d4a0321f1..08ffcba2fd45 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.cs similarity index 87% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.cs index 47090e2a4aee..31fa3d486f1e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// error details public partial class ExchangePolicyError : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorInternal { /// Backing field for property. @@ -38,6 +38,9 @@ public partial interface IExchangePolicyError : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -46,6 +49,9 @@ public partial interface IExchangePolicyError : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.json.cs index 99318f14b3e2..ce944711b2d0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyError.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyError.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ExchangePolicyError(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Run { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ExchangePolicyError(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.PowerShell.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.PowerShell.cs index 31534d8140da..e4be29a3f19a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ExchangePolicyErrors partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExchangePolicyErrors(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExchangePolicyErrors(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,13 +104,13 @@ internal ExchangePolicyErrors(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PolicyError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorsInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorsInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorsInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorsInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -125,7 +125,7 @@ internal ExchangePolicyErrors(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("PolicyError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorsInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorsInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorsInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorsInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -135,7 +135,7 @@ internal ExchangePolicyErrors(global::System.Management.Automation.PSObject cont /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.TypeConverter.cs index 24382ec49e08..8ccb7c279ded 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.cs similarity index 64% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.cs index 948ef4949890..420cd78b836f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Exchange policy errors public partial class ExchangePolicyErrors : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorsInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorsInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] _policyError; + private System.Collections.Generic.List _policyError; /// Exchange Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyError { get => this._policyError; set => this._policyError = value; } + public System.Collections.Generic.List PolicyError { get => this._policyError; set => this._policyError = value; } /// Creates an new instance. public ExchangePolicyErrors() @@ -34,10 +34,13 @@ public partial interface IExchangePolicyErrors : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Exchange Policy errors", SerializedName = @"policyErrors", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyError { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError) })] + System.Collections.Generic.List PolicyError { get; set; } } /// Exchange policy errors @@ -45,7 +48,7 @@ internal partial interface IExchangePolicyErrorsInternal { /// Exchange Policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyError { get; set; } + System.Collections.Generic.List PolicyError { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.json.cs index b7647d60fe31..9551f8ee2d4c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangePolicyErrors.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangePolicyErrors.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ExchangePolicyErrors(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Ru { return; } - {_policyError = If( json?.PropertyT("policyErrors"), out var __jsonPolicyErrors) ? If( __jsonPolicyErrors as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IExchangePolicyError) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyError.FromJson(__u) )) ))() : null : PolicyError;} + {_policyError = If( json?.PropertyT("policyErrors"), out var __jsonPolicyErrors) ? If( __jsonPolicyErrors as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyError.FromJson(__u) )) ))() : null : _policyError;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ExchangePolicyErrors(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.PowerShell.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.PowerShell.cs index d6d8ddfd8044..56201493f20a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ExchangeRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExchangeRequest(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExchangeRequest(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,17 +104,17 @@ internal ExchangeRequest(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("SessionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestInternal)this).SessionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestInternal)this).SessionId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -129,11 +129,11 @@ internal ExchangeRequest(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("SessionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestInternal)this).SessionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestInternal)this).SessionId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,7 +143,7 @@ internal ExchangeRequest(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.TypeConverter.cs index 8d31b9edc8f5..eee086c715b6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.cs similarity index 64% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.cs index d471d9928229..b609e7ec8fc6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.cs @@ -3,29 +3,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Exchange request public partial class ExchangeRequest : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestInternal { /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeRequestProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeRequestProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties _property; /// Exchange request properties [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeRequestProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeRequestProperties()); set => this._property = value; } /// SessionId that was returned by CalculateExchange API. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestPropertiesInternal)Property).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestPropertiesInternal)Property).SessionId = value ?? null; } + public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestPropertiesInternal)Property).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestPropertiesInternal)Property).SessionId = value ?? null; } /// Creates an new instance. public ExchangeRequest() @@ -41,6 +41,9 @@ public partial interface IExchangeRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"SessionId that was returned by CalculateExchange API.", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] @@ -52,7 +55,7 @@ internal partial interface IExchangeRequestInternal { /// Exchange request properties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties Property { get; set; } /// SessionId that was returned by CalculateExchange API. string SessionId { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.json.cs index acdf812fb1c1..e4c07407d6ea 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequest.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ExchangeRequest(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeRequestProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeRequestProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ExchangeRequest(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.PowerShell.cs similarity index 84% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.PowerShell.cs index 1b9d7bc37aa5..a8f74ac74c20 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class ExchangeRequestProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExchangeRequestProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExchangeRequestProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,13 +104,13 @@ internal ExchangeRequestProperties(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("SessionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestPropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestPropertiesInternal)this).SessionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestPropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestPropertiesInternal)this).SessionId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -127,7 +125,7 @@ internal ExchangeRequestProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("SessionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestPropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestPropertiesInternal)this).SessionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestPropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestPropertiesInternal)this).SessionId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -137,7 +135,7 @@ internal ExchangeRequestProperties(global::System.Management.Automation.PSObject /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.TypeConverter.cs index ad1191ed4825..37d2eb177257 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.cs similarity index 88% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.cs index 3b535c3b8727..4597a428c20d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Exchange request properties public partial class ExchangeRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestPropertiesInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface IExchangeRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"SessionId that was returned by CalculateExchange API.", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.json.cs similarity index 95% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.json.cs index 6f359404194a..d8637070fcc4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeRequestProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeRequestProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ExchangeRequestProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservatio { return; } - {_sessionId = If( json?.PropertyT("sessionId"), out var __jsonSessionId) ? (string)__jsonSessionId : (string)SessionId;} + {_sessionId = If( json?.PropertyT("sessionId"), out var __jsonSessionId) ? (string)__jsonSessionId : (string)_sessionId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ExchangeRequestProperties(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.PowerShell.cs similarity index 50% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.PowerShell.cs index 4390531baeb5..81d2c140026d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class ExchangeResponseProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExchangeResponseProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExchangeResponseProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,45 +104,45 @@ internal ExchangeResponseProperties(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("PolicyResult")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorsTypeConverter.ConvertFrom); } if (content.Contains("SessionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); } if (content.Contains("NetPayable")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("RefundsTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("PurchasesTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("ReservationsToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseExchangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseExchangeTypeConverter.ConvertFrom)); } if (content.Contains("SavingsPlansToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseExchangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseExchangeTypeConverter.ConvertFrom)); } if (content.Contains("ReservationsToExchange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnForExchangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnForExchangeTypeConverter.ConvertFrom)); } if (content.Contains("PolicyResultPolicyError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PolicyResultPolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[]) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PolicyResultPolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -159,39 +157,39 @@ internal ExchangeResponseProperties(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("PolicyResult")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorsTypeConverter.ConvertFrom); } if (content.Contains("SessionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); } if (content.Contains("NetPayable")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).NetPayable = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("NetPayable",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).NetPayable, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("RefundsTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).RefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("RefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).RefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("PurchasesTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PurchasesTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PurchasesTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PurchasesTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("ReservationsToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).ReservationsToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[]) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseExchangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).ReservationsToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).ReservationsToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseExchangeTypeConverter.ConvertFrom)); } if (content.Contains("SavingsPlansToPurchase")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[]) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseExchangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase = (System.Collections.Generic.List) content.GetValueForProperty("SavingsPlansToPurchase",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).SavingsPlansToPurchase, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseExchangeTypeConverter.ConvertFrom)); } if (content.Contains("ReservationsToExchange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).ReservationsToExchange = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[]) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnForExchangeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).ReservationsToExchange = (System.Collections.Generic.List) content.GetValueForProperty("ReservationsToExchange",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).ReservationsToExchange, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnForExchangeTypeConverter.ConvertFrom)); } if (content.Contains("PolicyResultPolicyError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PolicyResultPolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[]) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrorTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PolicyResultPolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyResultPolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal)this).PolicyResultPolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrorTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -201,7 +199,7 @@ internal ExchangeResponseProperties(global::System.Management.Automation.PSObjec /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.TypeConverter.cs index 12acc77ce6ac..83db3144614c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.cs similarity index 57% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.cs index 3ec238c70000..56a04de0f220 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.cs @@ -3,71 +3,71 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Exchange response properties public partial class ExchangeResponseProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal { /// Internal Acessors for PolicyResult - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponsePropertiesInternal.PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrors()); set { {_policyResult = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponsePropertiesInternal.PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrors()); set { {_policyResult = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _netPayable; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _netPayable; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get => (this._netPayable = this._netPayable ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._netPayable = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get => (this._netPayable = this._netPayable ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._netPayable = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors _policyResult; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors _policyResult; /// Exchange policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrors()); set => this._policyResult = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrors()); set => this._policyResult = value; } /// Exchange Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorsInternal)PolicyResult).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrorsInternal)PolicyResult).PolicyError = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PolicyResultPolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorsInternal)PolicyResult).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrorsInternal)PolicyResult).PolicyError = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _purchasesTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _purchasesTotal; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get => (this._purchasesTotal = this._purchasesTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._purchasesTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get => (this._purchasesTotal = this._purchasesTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._purchasesTotal = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _refundsTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _refundsTotal; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get => (this._refundsTotal = this._refundsTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._refundsTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get => (this._refundsTotal = this._refundsTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._refundsTotal = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[] _reservationsToExchange; + private System.Collections.Generic.List _reservationsToExchange; /// Details of the reservations being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[] ReservationsToExchange { get => this._reservationsToExchange; set => this._reservationsToExchange = value; } + public System.Collections.Generic.List ReservationsToExchange { get => this._reservationsToExchange; set => this._reservationsToExchange = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[] _reservationsToPurchase; + private System.Collections.Generic.List _reservationsToPurchase; /// Details of the reservations being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[] ReservationsToPurchase { get => this._reservationsToPurchase; set => this._reservationsToPurchase = value; } + public System.Collections.Generic.List ReservationsToPurchase { get => this._reservationsToPurchase; set => this._reservationsToPurchase = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[] _savingsPlansToPurchase; + private System.Collections.Generic.List _savingsPlansToPurchase; /// Details of the savings plans being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[] SavingsPlansToPurchase { get => this._savingsPlansToPurchase; set => this._savingsPlansToPurchase = value; } + public System.Collections.Generic.List SavingsPlansToPurchase { get => this._savingsPlansToPurchase; set => this._savingsPlansToPurchase = value; } /// Backing field for property. private string _sessionId; @@ -90,62 +90,86 @@ public partial interface IExchangeResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"netPayable", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get; set; } /// Exchange Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Exchange Policy errors", SerializedName = @"policyErrors", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyError) })] + System.Collections.Generic.List PolicyResultPolicyError { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"purchasesTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"refundsTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get; set; } /// Details of the reservations being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the reservations being returned", SerializedName = @"reservationsToExchange", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[] ReservationsToExchange { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange) })] + System.Collections.Generic.List ReservationsToExchange { get; set; } /// Details of the reservations being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the reservations being purchased", SerializedName = @"reservationsToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[] ReservationsToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange) })] + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// Details of the savings plans being purchased [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Details of the savings plans being purchased", SerializedName = @"savingsPlansToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[] SavingsPlansToPurchase { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchange) })] + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } /// Exchange session identifier [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Exchange session identifier", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] @@ -157,21 +181,21 @@ internal partial interface IExchangeResponsePropertiesInternal { /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice NetPayable { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice NetPayable { get; set; } /// Exchange policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyErrors PolicyResult { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangePolicyErrors PolicyResult { get; set; } /// Exchange Policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangePolicyError[] PolicyResultPolicyError { get; set; } + System.Collections.Generic.List PolicyResultPolicyError { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PurchasesTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PurchasesTotal { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice RefundsTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice RefundsTotal { get; set; } /// Details of the reservations being returned - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange[] ReservationsToExchange { get; set; } + System.Collections.Generic.List ReservationsToExchange { get; set; } /// Details of the reservations being purchased - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange[] ReservationsToPurchase { get; set; } + System.Collections.Generic.List ReservationsToPurchase { get; set; } /// Details of the savings plans being purchased - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange[] SavingsPlansToPurchase { get; set; } + System.Collections.Generic.List SavingsPlansToPurchase { get; set; } /// Exchange session identifier string SessionId { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.json.cs similarity index 83% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.json.cs index f062d2b75fa9..4a00477b3193 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExchangeResponseProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExchangeResponseProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,25 +65,25 @@ internal ExchangeResponseProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservati { return; } - {_policyResult = If( json?.PropertyT("policyResult"), out var __jsonPolicyResult) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangePolicyErrors.FromJson(__jsonPolicyResult) : PolicyResult;} - {_sessionId = If( json?.PropertyT("sessionId"), out var __jsonSessionId) ? (string)__jsonSessionId : (string)SessionId;} - {_netPayable = If( json?.PropertyT("netPayable"), out var __jsonNetPayable) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonNetPayable) : NetPayable;} - {_refundsTotal = If( json?.PropertyT("refundsTotal"), out var __jsonRefundsTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonRefundsTotal) : RefundsTotal;} - {_purchasesTotal = If( json?.PropertyT("purchasesTotal"), out var __jsonPurchasesTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonPurchasesTotal) : PurchasesTotal;} - {_reservationsToPurchase = If( json?.PropertyT("reservationsToPurchase"), out var __jsonReservationsToPurchase) ? If( __jsonReservationsToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IReservationToPurchaseExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToPurchaseExchange.FromJson(__u) )) ))() : null : ReservationsToPurchase;} - {_savingsPlansToPurchase = If( json?.PropertyT("savingsPlansToPurchase"), out var __jsonSavingsPlansToPurchase) ? If( __jsonSavingsPlansToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanToPurchaseExchange.FromJson(__p) )) ))() : null : SavingsPlansToPurchase;} - {_reservationsToExchange = If( json?.PropertyT("reservationsToExchange"), out var __jsonReservationsToExchange) ? If( __jsonReservationsToExchange as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnForExchange.FromJson(__k) )) ))() : null : ReservationsToExchange;} + {_policyResult = If( json?.PropertyT("policyResult"), out var __jsonPolicyResult) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangePolicyErrors.FromJson(__jsonPolicyResult) : _policyResult;} + {_sessionId = If( json?.PropertyT("sessionId"), out var __jsonSessionId) ? (string)__jsonSessionId : (string)_sessionId;} + {_netPayable = If( json?.PropertyT("netPayable"), out var __jsonNetPayable) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonNetPayable) : _netPayable;} + {_refundsTotal = If( json?.PropertyT("refundsTotal"), out var __jsonRefundsTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonRefundsTotal) : _refundsTotal;} + {_purchasesTotal = If( json?.PropertyT("purchasesTotal"), out var __jsonPurchasesTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonPurchasesTotal) : _purchasesTotal;} + {_reservationsToPurchase = If( json?.PropertyT("reservationsToPurchase"), out var __jsonReservationsToPurchase) ? If( __jsonReservationsToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToPurchaseExchange.FromJson(__u) )) ))() : null : _reservationsToPurchase;} + {_savingsPlansToPurchase = If( json?.PropertyT("savingsPlansToPurchase"), out var __jsonSavingsPlansToPurchase) ? If( __jsonSavingsPlansToPurchase as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanToPurchaseExchange.FromJson(__p) )) ))() : null : _savingsPlansToPurchase;} + {_reservationsToExchange = If( json?.PropertyT("reservationsToExchange"), out var __jsonReservationsToExchange) ? If( __jsonReservationsToExchange as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnForExchange.FromJson(__k) )) ))() : null : _reservationsToExchange;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeResponseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeResponseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ExchangeResponseProperties(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.PowerShell.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.PowerShell.cs index c073209707f6..3baa960987a6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ExtendedErrorInfo partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExtendedErrorInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExtendedErrorInfo(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,17 +104,17 @@ internal ExtendedErrorInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)this).Code = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)this).Code, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -129,11 +129,11 @@ internal ExtendedErrorInfo(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)this).Code = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)this).Code, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfoInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,7 +143,7 @@ internal ExtendedErrorInfo(global::System.Management.Automation.PSObject content /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.TypeConverter.cs index 5b17c9ca58f5..03a04ba50b68 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.cs new file mode 100644 index 000000000000..a2d78a2a7620 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + + /// Extended error information including error code and error message + public partial class ExtendedErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfoInternal + { + + /// Backing field for property. + private string _code; + + /// + /// Error code describing the reason that service is not able to process the incoming request + /// + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public ExtendedErrorInfo() + { + + } + } + /// Extended error information including error code and error message + public partial interface IExtendedErrorInfo : + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable + { + /// + /// Error code describing the reason that service is not able to process the incoming request + /// + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Error code describing the reason that service is not able to process the incoming request", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("NotSpecified", "InternalServerError", "ServerTimeout", "AuthorizationFailed", "BadRequest", "ClientCertificateThumbprintNotSet", "InvalidRequestContent", "OperationFailed", "HttpMethodNotSupported", "InvalidRequestUri", "MissingTenantId", "InvalidTenantId", "InvalidReservationOrderId", "InvalidReservationId", "ReservationIdNotInReservationOrder", "ReservationOrderNotFound", "InvalidSubscriptionId", "InvalidAccessToken", "InvalidLocationId", "UnauthenticatedRequestsThrottled", "InvalidHealthCheckType", "Forbidden", "BillingScopeIdCannotBeChanged", "AppliedScopesNotAssociatedWithCommerceAccount", "PatchValuesSameAsExisting", "RoleAssignmentCreationFailed", "ReservationOrderCreationFailed", "ReservationOrderNotEnabled", "CapacityUpdateScopesFailed", "UnsupportedReservationTerm", "ReservationOrderIdAlreadyExists", "RiskCheckFailed", "CreateQuoteFailed", "ActivateQuoteFailed", "NonsupportedAccountId", "PaymentInstrumentNotFound", "MissingAppliedScopesForSingle", "NoValidReservationsToReRate", "ReRateOnlyAllowedForEA", "OperationCannotBePerformedInCurrentState", "InvalidSingleAppliedScopesCount", "InvalidFulfillmentRequestParameters", "NotSupportedCountry", "InvalidRefundQuantity", "PurchaseError", "BillingCustomerInputError", "BillingPaymentInstrumentSoftError", "BillingPaymentInstrumentHardError", "BillingTransientError", "BillingError", "FulfillmentConfigurationError", "FulfillmentOutOfStockError", "FulfillmentTransientError", "FulfillmentError", "CalculatePriceFailed", "AppliedScopesSameAsExisting", "SelfServiceRefundNotSupported", "RefundLimitExceeded")] + string Code { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// Extended error information including error code and error message + internal partial interface IExtendedErrorInfoInternal + + { + /// + /// Error code describing the reason that service is not able to process the incoming request + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("NotSpecified", "InternalServerError", "ServerTimeout", "AuthorizationFailed", "BadRequest", "ClientCertificateThumbprintNotSet", "InvalidRequestContent", "OperationFailed", "HttpMethodNotSupported", "InvalidRequestUri", "MissingTenantId", "InvalidTenantId", "InvalidReservationOrderId", "InvalidReservationId", "ReservationIdNotInReservationOrder", "ReservationOrderNotFound", "InvalidSubscriptionId", "InvalidAccessToken", "InvalidLocationId", "UnauthenticatedRequestsThrottled", "InvalidHealthCheckType", "Forbidden", "BillingScopeIdCannotBeChanged", "AppliedScopesNotAssociatedWithCommerceAccount", "PatchValuesSameAsExisting", "RoleAssignmentCreationFailed", "ReservationOrderCreationFailed", "ReservationOrderNotEnabled", "CapacityUpdateScopesFailed", "UnsupportedReservationTerm", "ReservationOrderIdAlreadyExists", "RiskCheckFailed", "CreateQuoteFailed", "ActivateQuoteFailed", "NonsupportedAccountId", "PaymentInstrumentNotFound", "MissingAppliedScopesForSingle", "NoValidReservationsToReRate", "ReRateOnlyAllowedForEA", "OperationCannotBePerformedInCurrentState", "InvalidSingleAppliedScopesCount", "InvalidFulfillmentRequestParameters", "NotSupportedCountry", "InvalidRefundQuantity", "PurchaseError", "BillingCustomerInputError", "BillingPaymentInstrumentSoftError", "BillingPaymentInstrumentHardError", "BillingTransientError", "BillingError", "FulfillmentConfigurationError", "FulfillmentOutOfStockError", "FulfillmentTransientError", "FulfillmentError", "CalculatePriceFailed", "AppliedScopesSameAsExisting", "SelfServiceRefundNotSupported", "RefundLimitExceeded")] + string Code { get; set; } + + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.json.cs index 8a90edbbda9e..a982d9c4be08 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedErrorInfo.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedErrorInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ExtendedErrorInfo(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runti { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedErrorInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedErrorInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ExtendedErrorInfo(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.PowerShell.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.PowerShell.cs index 0811b086a95a..d37aac1e31f3 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -62,33 +62,33 @@ public partial class ExtendedStatusInfo partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExtendedStatusInfo(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExtendedStatusInfo(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +103,17 @@ internal ExtendedStatusInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("StatusCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfoInternal)this).StatusCode = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode?) content.GetValueForProperty("StatusCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfoInternal)this).StatusCode, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfoInternal)this).StatusCode = (string) content.GetValueForProperty("StatusCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfoInternal)this).StatusCode, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfoInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfoInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +128,11 @@ internal ExtendedStatusInfo(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("StatusCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfoInternal)this).StatusCode = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode?) content.GetValueForProperty("StatusCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfoInternal)this).StatusCode, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfoInternal)this).StatusCode = (string) content.GetValueForProperty("StatusCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfoInternal)this).StatusCode, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfoInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfoInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfoInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -142,7 +142,7 @@ internal ExtendedStatusInfo(global::System.Management.Automation.PSObject conten /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.TypeConverter.cs index acc68c35296a..31eee6948f73 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.cs similarity index 69% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.cs index 738a39588684..ff7ad7bf9a5f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; public partial class ExtendedStatusInfo : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfoInternal { /// Backing field for property. @@ -20,10 +20,10 @@ public partial class ExtendedStatusInfo : public string Message { get => this._message; set => this._message = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode? _statusCode; + private string _statusCode; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode? StatusCode { get => this._statusCode; set => this._statusCode = value; } + public string StatusCode { get => this._statusCode; set => this._statusCode = value; } /// Creates an new instance. public ExtendedStatusInfo() @@ -38,6 +38,9 @@ public partial interface IExtendedStatusInfo : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The message giving detailed information about the status code.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -46,10 +49,14 @@ public partial interface IExtendedStatusInfo : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"statusCode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode? StatusCode { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("None", "Pending", "Processing", "Active", "PurchaseError", "PaymentInstrumentError", "Split", "Merged", "Expired", "Succeeded")] + string StatusCode { get; set; } } internal partial interface IExtendedStatusInfoInternal @@ -58,7 +65,8 @@ internal partial interface IExtendedStatusInfoInternal /// The message giving detailed information about the status code. string Message { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode? StatusCode { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("None", "Pending", "Processing", "Active", "PurchaseError", "PaymentInstrumentError", "Split", "Merged", "Expired", "Succeeded")] + string StatusCode { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.json.cs similarity index 95% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.json.cs index 87e0be5a18d4..c8a2b9afb296 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ExtendedStatusInfo.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ExtendedStatusInfo.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -64,19 +64,19 @@ internal ExtendedStatusInfo(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runt { return; } - {_statusCode = If( json?.PropertyT("statusCode"), out var __jsonStatusCode) ? (string)__jsonStatusCode : (string)StatusCode;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_statusCode = If( json?.PropertyT("statusCode"), out var __jsonStatusCode) ? (string)__jsonStatusCode : (string)_statusCode;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ExtendedStatusInfo(json) : null; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.PowerShell.cs similarity index 84% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.PowerShell.cs index f91198517a98..d4780ba4d66b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class MergeProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MergeProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MergeProperties(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,13 +111,13 @@ internal MergeProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Source")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergePropertiesInternal)this).Source = (string[]) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergePropertiesInternal)this).Source, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergePropertiesInternal)this).Source = (System.Collections.Generic.List) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergePropertiesInternal)this).Source, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,7 +132,7 @@ internal MergeProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Source")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergePropertiesInternal)this).Source = (string[]) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergePropertiesInternal)this).Source, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergePropertiesInternal)this).Source = (System.Collections.Generic.List) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergePropertiesInternal)this).Source, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.TypeConverter.cs index fc6934c6bc87..7be7b4a48203 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.cs index 42606c1811d7..503cce6f1263 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.cs @@ -3,24 +3,24 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties for reservation merge public partial class MergeProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergePropertiesInternal { /// Backing field for property. - private string[] _source; + private System.Collections.Generic.List _source; /// /// Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public string[] Source { get => this._source; set => this._source = value; } + public System.Collections.Generic.List Source { get => this._source; set => this._source = value; } /// Creates an new instance. public MergeProperties() @@ -38,10 +38,13 @@ public partial interface IMergeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"sources", PossibleTypes = new [] { typeof(string) })] - string[] Source { get; set; } + System.Collections.Generic.List Source { get; set; } } /// Properties for reservation merge @@ -51,7 +54,7 @@ internal partial interface IMergePropertiesInternal /// /// Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// - string[] Source { get; set; } + System.Collections.Generic.List Source { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.json.cs index 0913debaa20d..dff49b9c231c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MergeProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new MergeProperties(json) : null; } @@ -77,7 +77,7 @@ internal MergeProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime { return; } - {_source = If( json?.PropertyT("sources"), out var __jsonSources) ? If( __jsonSources as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Source;} + {_source = If( json?.PropertyT("sources"), out var __jsonSources) ? If( __jsonSources as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _source;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.PowerShell.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.PowerShell.cs index dcaa6512de1b..bfb96ffc32e0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class MergeRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MergeRequest(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MergeRequest(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal MergeRequest(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.MergePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.MergePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Source")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequestInternal)this).Source = (string[]) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequestInternal)this).Source, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequestInternal)this).Source = (System.Collections.Generic.List) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequestInternal)this).Source, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal MergeRequest(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.MergePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.MergePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Source")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequestInternal)this).Source = (string[]) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequestInternal)this).Source, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequestInternal)this).Source = (System.Collections.Generic.List) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequestInternal)this).Source, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.TypeConverter.cs index 60fbd60d4e73..22594e612643 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.cs similarity index 66% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.cs index 31337461459b..49c379639065 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.cs @@ -3,31 +3,31 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The request for reservation merge public partial class MergeRequest : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequestInternal { /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.MergeProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.MergeProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties _property; /// Properties for reservation merge [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.MergeProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.MergeProperties()); set => this._property = value; } /// /// Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string[] Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergePropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergePropertiesInternal)Property).Source = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergePropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergePropertiesInternal)Property).Source = value ?? null /* arrayOf */; } /// Creates an new instance. public MergeRequest() @@ -45,10 +45,13 @@ public partial interface IMergeRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"sources", PossibleTypes = new [] { typeof(string) })] - string[] Source { get; set; } + System.Collections.Generic.List Source { get; set; } } /// The request for reservation merge @@ -56,11 +59,11 @@ internal partial interface IMergeRequestInternal { /// Properties for reservation merge - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeProperties Property { get; set; } /// /// Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// - string[] Source { get; set; } + System.Collections.Generic.List Source { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.json.cs index c40dca735254..52c377dd864b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/MergeRequest.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/MergeRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MergeRequest partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new MergeRequest(json) : null; } @@ -77,7 +77,7 @@ internal MergeRequest(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Js { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.MergeProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.MergeProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 74% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index 9557bc2216d2..19e870f1c1e6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationDisplay partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationDisplay(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,25 +111,25 @@ internal OperationDisplay(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,19 +144,19 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index 7f054f0de6d1..53bf3339eb51 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.cs similarity index 89% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.cs index bb4b67452b20..b4aef009a17e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Information about an operation public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal { /// Backing field for property. @@ -50,6 +50,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -58,6 +61,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -66,6 +72,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -74,6 +83,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.json.cs index 733fdcaec54d..cee1d053085a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationDisplay.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationDisplay.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtim { return; } - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.PowerShell.cs similarity index 77% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.PowerShell.cs index e7c275b680e7..38e9863ce6f9 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationList(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal OperationList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResponseTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal OperationList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResponseTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.TypeConverter.cs index 0206d935c0d3..443309ee8ce4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.cs similarity index 71% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.cs index 3329ba5d931f..f409c705d837 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Paginated list of operations public partial class OperationList : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationListInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationListInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class OperationList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse[] _value; + private System.Collections.Generic.List _value; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public OperationList() @@ -40,6 +40,9 @@ public partial interface IOperationList : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Url to get the next page of items.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -48,10 +51,13 @@ public partial interface IOperationList : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse) })] + System.Collections.Generic.List Value { get; set; } } /// Paginated list of operations @@ -61,7 +67,7 @@ internal partial interface IOperationListInternal /// Url to get the next page of items. string NextLink { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.json.cs index 13a33956dc17..386eb024f84c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationList.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationList.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new OperationList(json) : null; } @@ -77,8 +77,8 @@ internal OperationList(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.J { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IOperationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationResponse.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationResponse.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.PowerShell.cs similarity index 61% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.PowerShell.cs index c18c5d275bca..e62f13025a68 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationResponse(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,45 +111,45 @@ internal OperationResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Origin, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AnyTypeConverter.ConvertFrom); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -164,39 +164,39 @@ internal OperationResponse(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Origin, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAny) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AnyTypeConverter.ConvertFrom); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.TypeConverter.cs index a20bda588d49..6eac04de7498 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.cs similarity index 77% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.cs index 04661d46e894..7cd57d6fac61 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.cs @@ -3,34 +3,34 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The response containing operation information public partial class OperationResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay _display; /// Display of the operation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationDisplay()); set => this._display = value; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)Display).Description = value ?? null; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)Display).Description = value ?? null; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)Display).Operation = value ?? null; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)Display).Provider = value ?? null; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)Display).Provider = value ?? null; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplayInternal)Display).Resource = value ?? null; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } /// Backing field for property. private bool? _isDataAction; @@ -40,7 +40,7 @@ public partial class OperationResponse : public bool? IsDataAction { get => this._isDataAction; set => this._isDataAction = value; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponseInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponseInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationDisplay()); set { {_display = value;} } } /// Backing field for property. private string _name; @@ -76,6 +76,9 @@ public partial interface IOperationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -84,6 +87,9 @@ public partial interface IOperationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +98,9 @@ public partial interface IOperationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -100,6 +109,9 @@ public partial interface IOperationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +120,9 @@ public partial interface IOperationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the operation is a data action", SerializedName = @"isDataAction", PossibleTypes = new [] { typeof(bool) })] @@ -116,6 +131,9 @@ public partial interface IOperationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the operation", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -124,6 +142,9 @@ public partial interface IOperationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Origin of the operation", SerializedName = @"origin", PossibleTypes = new [] { typeof(string) })] @@ -132,6 +153,9 @@ public partial interface IOperationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Properties of the operation", SerializedName = @"properties", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAny) })] @@ -143,7 +167,7 @@ internal partial interface IOperationResponseInternal { /// Display of the operation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationDisplay Display { get; set; } string DisplayDescription { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.json.cs similarity index 93% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.json.cs index 3f6dcca81382..a37afe0e2bbe 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new OperationResponse(json) : null; } @@ -77,11 +77,11 @@ internal OperationResponse(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runti { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction;} - {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Any.FromJson(__jsonProperties) : Property;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : _isDataAction;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)_origin;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Any.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.PowerShell.cs similarity index 81% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.PowerShell.cs index 88be2ed05c2b..cbd3c9cabfbb 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationResultError partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationResultError(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationResultError(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal OperationResultError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal OperationResultError(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.TypeConverter.cs index 9c2f4366ae3c..00848c8f7075 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.cs index ac0bf19f0bfa..4ec3ea1f3472 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Required if status == failed or status == canceled. public partial class OperationResultError : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultErrorInternal { /// Backing field for property. @@ -50,6 +50,9 @@ public partial interface IOperationResultError : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Required if status == failed or status == cancelled. If status == failed, provide an invariant error code used for error troubleshooting, aggregation, and analysis.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IOperationResultError : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Required if status == failed. Localized. If status == failed, provide an actionable error message indicating what error occurred, and what the user can do to address the issue.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.json.cs index 289003556744..6c099f1c7351 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/OperationResultError.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/OperationResultError.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationResultError partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResultError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResultError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new OperationResultError(json) : null; } @@ -77,8 +77,8 @@ internal OperationResultError(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Ru { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.PowerShell.cs similarity index 53% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.PowerShell.cs index 944fee63d50f..2e226cc14b48 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Patch partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Patch(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Patch(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,65 +111,65 @@ internal Patch(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchPropertiesTypeConverter.ConvertFrom); } if (content.Contains("AppliedScope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScope = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("InstanceFlexibility")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).InstanceFlexibility, global::System.Convert.ToString); } if (content.Contains("Renew")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("AppliedScopeProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); } if (content.Contains("AppliedScopeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopeType, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("RenewProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchPropertiesRenewPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchPropertiesRenewPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ReviewDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("AppliedScopePropertyTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertySubscriptionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyManagementGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyResourceGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -184,59 +184,59 @@ internal Patch(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchPropertiesTypeConverter.ConvertFrom); } if (content.Contains("AppliedScope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScope = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("InstanceFlexibility")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).InstanceFlexibility, global::System.Convert.ToString); } if (content.Contains("Renew")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("AppliedScopeProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); } if (content.Contains("AppliedScopeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopeType, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("RenewProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchPropertiesRenewPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchPropertiesRenewPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ReviewDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("AppliedScopePropertyTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertySubscriptionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyManagementGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyResourceGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.TypeConverter.cs index 23c8e3e897e9..41019645b2d1 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.cs similarity index 65% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.cs index 704ef4deaab4..23abd0da3bd0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The request for reservation patch public partial class Patch : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal { /// @@ -18,70 +18,70 @@ public partial class Patch : /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string[] AppliedScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScope = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AppliedScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScope = value ?? null /* arrayOf */; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopePropertyDisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopePropertyDisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopePropertyManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopePropertyManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopePropertyResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopePropertyResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopePropertySubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopePropertySubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopePropertyTenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopePropertyTenantId = value ?? null; } /// Type of the Applied Scope. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopeType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); } + public string AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopeType = value ?? null; } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).InstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).InstanceFlexibility = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); } + public string InstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).InstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).InstanceFlexibility = value ?? null; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).AppliedScopeProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).AppliedScopeProperty = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchProperties()); set { {_property = value;} } } /// Display name of the reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).Name = value ?? null; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).Name = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties _property; /// Properties for reservation patch [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchProperties()); set => this._property = value; } /// /// Setting this to true will automatically purchase a new reservation on the expiration date time. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public bool? Renew { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).Renew; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).Renew = value ?? default(bool); } + public bool? Renew { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).Renew; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).Renew = value ?? default(bool); } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties RenewProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).RenewProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).RenewProperty = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties RenewProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).RenewProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).RenewProperty = value ?? null /* model class */; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)Property).ReviewDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)Property).ReviewDateTime = value ?? default(global::System.DateTime); } /// Creates an new instance. public Patch() @@ -100,14 +100,20 @@ public partial interface IPatch : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - string[] AppliedScope { get; set; } + System.Collections.Generic.List AppliedScope { get; set; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -118,6 +124,9 @@ public partial interface IPatch : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -126,6 +135,9 @@ public partial interface IPatch : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -134,6 +146,9 @@ public partial interface IPatch : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -142,6 +157,9 @@ public partial interface IPatch : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -150,10 +168,14 @@ public partial interface IPatch : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. @@ -161,14 +183,21 @@ public partial interface IPatch : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } /// Display name of the reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the reservation", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -179,6 +208,9 @@ public partial interface IPatch : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Setting this to true will automatically purchase a new reservation on the expiration date time.", SerializedName = @"renew", PossibleTypes = new [] { typeof(bool) })] @@ -187,14 +219,20 @@ public partial interface IPatch : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"renewProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties RenewProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties RenewProperty { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the Azure hybrid benefit needs to be reviewed.", SerializedName = @"reviewDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -209,12 +247,12 @@ internal partial interface IPatchInternal /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// - string[] AppliedScope { get; set; } + System.Collections.Generic.List AppliedScope { get; set; } /// /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -228,22 +266,24 @@ internal partial interface IPatchInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// Type of the Applied Scope. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } /// Display name of the reservation string Name { get; set; } /// Properties for reservation patch - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties Property { get; set; } /// /// Setting this to true will automatically purchase a new reservation on the expiration date time. /// bool? Renew { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties RenewProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties RenewProperty { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. global::System.DateTime? ReviewDateTime { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.json.cs similarity index 93% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.json.cs index e191ca80d264..84c4e1d7baee 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Patch.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Patch.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Patch partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch. + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new Patch(json) : null; } @@ -77,7 +75,7 @@ internal Patch(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.Json { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.PowerShell.cs similarity index 53% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.PowerShell.cs index 5c4208606605..34055e9f4d5d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class PatchProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PatchProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PatchProperties(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,61 +111,61 @@ internal PatchProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("AppliedScopeProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); } if (content.Contains("AppliedScopeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopeType, global::System.Convert.ToString); } if (content.Contains("AppliedScope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScope = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("InstanceFlexibility")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).InstanceFlexibility, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Renew")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("RenewProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchPropertiesRenewPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchPropertiesRenewPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ReviewDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("AppliedScopePropertyTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertySubscriptionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyManagementGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyResourceGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -180,55 +180,55 @@ internal PatchProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("AppliedScopeProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); } if (content.Contains("AppliedScopeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopeType, global::System.Convert.ToString); } if (content.Contains("AppliedScope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScope = (string[]) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScope = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("InstanceFlexibility")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).InstanceFlexibility, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Renew")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("RenewProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchPropertiesRenewPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchPropertiesRenewPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ReviewDateTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("AppliedScopePropertyTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertySubscriptionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyManagementGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyResourceGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.TypeConverter.cs index ed54dd1117aa..d01e05213fb8 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.cs similarity index 72% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.cs index 9a94133be911..85c21534d771 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.cs @@ -3,77 +3,77 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties for reservation patch public partial class PatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal { /// Backing field for property. - private string[] _appliedScope; + private System.Collections.Generic.List _appliedScope; /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public string[] AppliedScope { get => this._appliedScope; set => this._appliedScope = value; } + public System.Collections.Generic.List AppliedScope { get => this._appliedScope; set => this._appliedScope = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties _appliedScopeProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties _appliedScopeProperty; /// /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties()); set => this._appliedScopeProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties()); set => this._appliedScopeProperty = value; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? _appliedScopeType; + private string _appliedScopeType; /// Type of the Applied Scope. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => this._appliedScopeType; set => this._appliedScopeType = value; } + public string AppliedScopeType { get => this._appliedScopeType; set => this._appliedScopeType = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? _instanceFlexibility; + private string _instanceFlexibility; /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get => this._instanceFlexibility; set => this._instanceFlexibility = value; } + public string InstanceFlexibility { get => this._instanceFlexibility; set => this._instanceFlexibility = value; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesInternal.AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties()); set { {_appliedScopeProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesInternal.AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties()); set { {_appliedScopeProperty = value;} } } /// Backing field for property. private string _name; @@ -92,10 +92,10 @@ public partial class PatchProperties : public bool? Renew { get => this._renew; set => this._renew = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties _renewProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties _renewProperty; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties RenewProperty { get => (this._renewProperty = this._renewProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchPropertiesRenewProperties()); set => this._renewProperty = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties RenewProperty { get => (this._renewProperty = this._renewProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchPropertiesRenewProperties()); set => this._renewProperty = value; } /// Backing field for property. private global::System.DateTime? _reviewDateTime; @@ -121,14 +121,20 @@ public partial interface IPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - string[] AppliedScope { get; set; } + System.Collections.Generic.List AppliedScope { get; set; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -139,6 +145,9 @@ public partial interface IPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -147,6 +156,9 @@ public partial interface IPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -155,6 +167,9 @@ public partial interface IPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +178,9 @@ public partial interface IPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -171,10 +189,14 @@ public partial interface IPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. @@ -182,14 +204,21 @@ public partial interface IPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } /// Display name of the reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the reservation", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -200,6 +229,9 @@ public partial interface IPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Setting this to true will automatically purchase a new reservation on the expiration date time.", SerializedName = @"renew", PossibleTypes = new [] { typeof(bool) })] @@ -208,14 +240,20 @@ public partial interface IPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"renewProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties RenewProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties RenewProperty { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the Azure hybrid benefit needs to be reviewed.", SerializedName = @"reviewDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -230,12 +268,12 @@ internal partial interface IPatchPropertiesInternal /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// - string[] AppliedScope { get; set; } + System.Collections.Generic.List AppliedScope { get; set; } /// /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -249,12 +287,14 @@ internal partial interface IPatchPropertiesInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// Type of the Applied Scope. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } /// Display name of the reservation string Name { get; set; } /// @@ -262,7 +302,7 @@ internal partial interface IPatchPropertiesInternal /// bool? Renew { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties RenewProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties RenewProperty { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. global::System.DateTime? ReviewDateTime { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.json.cs similarity index 89% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.json.cs index 62a2b7531a58..aaaf1cd160e4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PatchProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new PatchProperties(json) : null; } @@ -77,14 +77,14 @@ internal PatchProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime { return; } - {_appliedScopeProperty = If( json?.PropertyT("appliedScopeProperties"), out var __jsonAppliedScopeProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties.FromJson(__jsonAppliedScopeProperties) : AppliedScopeProperty;} - {_appliedScopeType = If( json?.PropertyT("appliedScopeType"), out var __jsonAppliedScopeType) ? (string)__jsonAppliedScopeType : (string)AppliedScopeType;} - {_appliedScope = If( json?.PropertyT("appliedScopes"), out var __jsonAppliedScopes) ? If( __jsonAppliedScopes as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AppliedScope;} - {_instanceFlexibility = If( json?.PropertyT("instanceFlexibility"), out var __jsonInstanceFlexibility) ? (string)__jsonInstanceFlexibility : (string)InstanceFlexibility;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_renew = If( json?.PropertyT("renew"), out var __jsonRenew) ? (bool?)__jsonRenew : Renew;} - {_renewProperty = If( json?.PropertyT("renewProperties"), out var __jsonRenewProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PatchPropertiesRenewProperties.FromJson(__jsonRenewProperties) : RenewProperty;} - {_reviewDateTime = If( json?.PropertyT("reviewDateTime"), out var __jsonReviewDateTime) ? global::System.DateTime.TryParse((string)__jsonReviewDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReviewDateTimeValue) ? __jsonReviewDateTimeValue : ReviewDateTime : ReviewDateTime;} + {_appliedScopeProperty = If( json?.PropertyT("appliedScopeProperties"), out var __jsonAppliedScopeProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties.FromJson(__jsonAppliedScopeProperties) : _appliedScopeProperty;} + {_appliedScopeType = If( json?.PropertyT("appliedScopeType"), out var __jsonAppliedScopeType) ? (string)__jsonAppliedScopeType : (string)_appliedScopeType;} + {_appliedScope = If( json?.PropertyT("appliedScopes"), out var __jsonAppliedScopes) ? If( __jsonAppliedScopes as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _appliedScope;} + {_instanceFlexibility = If( json?.PropertyT("instanceFlexibility"), out var __jsonInstanceFlexibility) ? (string)__jsonInstanceFlexibility : (string)_instanceFlexibility;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_renew = If( json?.PropertyT("renew"), out var __jsonRenew) ? (bool?)__jsonRenew : _renew;} + {_renewProperty = If( json?.PropertyT("renewProperties"), out var __jsonRenewProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PatchPropertiesRenewProperties.FromJson(__jsonRenewProperties) : _renewProperty;} + {_reviewDateTime = If( json?.PropertyT("reviewDateTime"), out var __jsonReviewDateTime) ? global::System.DateTime.TryParse((string)__jsonReviewDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReviewDateTimeValue) ? __jsonReviewDateTimeValue : _reviewDateTime : _reviewDateTime;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.PowerShell.cs similarity index 80% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.PowerShell.cs index 39d166c9e7db..0feaed5cf158 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -62,29 +62,27 @@ public partial class PatchPropertiesRenewProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PatchPropertiesRenewProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PatchPropertiesRenewProperties(content); } @@ -94,10 +92,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -112,13 +110,13 @@ internal PatchPropertiesRenewProperties(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("PurchaseProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewPropertiesInternal)this).PurchaseProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) content.GetValueForProperty("PurchaseProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewPropertiesInternal)this).PurchaseProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewPropertiesInternal)this).PurchaseProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) content.GetValueForProperty("PurchaseProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewPropertiesInternal)this).PurchaseProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,7 +131,7 @@ internal PatchPropertiesRenewProperties(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("PurchaseProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewPropertiesInternal)this).PurchaseProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) content.GetValueForProperty("PurchaseProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewPropertiesInternal)this).PurchaseProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewPropertiesInternal)this).PurchaseProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) content.GetValueForProperty("PurchaseProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewPropertiesInternal)this).PurchaseProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.TypeConverter.cs index a694b067157d..2c1b707da71d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.cs similarity index 68% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.cs index 37ddbf11df34..407d49354795 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; public partial class PatchPropertiesRenewProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest _purchaseProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest _purchaseProperty; /// The request for reservation purchase [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest PurchaseProperty { get => (this._purchaseProperty = this._purchaseProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest()); set => this._purchaseProperty = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest PurchaseProperty { get => (this._purchaseProperty = this._purchaseProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest()); set => this._purchaseProperty = value; } /// Creates an new instance. public PatchPropertiesRenewProperties() @@ -32,17 +32,20 @@ public partial interface IPatchPropertiesRenewProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The request for reservation purchase", SerializedName = @"purchaseProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest PurchaseProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest PurchaseProperty { get; set; } } internal partial interface IPatchPropertiesRenewPropertiesInternal { /// The request for reservation purchase - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest PurchaseProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest PurchaseProperty { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.json.cs similarity index 93% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.json.cs index 12f547638df0..f79ffc888ac6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PatchPropertiesRenewProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PatchPropertiesRenewProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -53,13 +53,13 @@ public partial class PatchPropertiesRenewProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new PatchPropertiesRenewProperties(json) : null; } @@ -76,7 +76,7 @@ internal PatchPropertiesRenewProperties(Microsoft.Azure.PowerShell.Cmdlets.Reser { return; } - {_purchaseProperty = If( json?.PropertyT("purchaseProperties"), out var __jsonPurchaseProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest.FromJson(__jsonPurchaseProperties) : PurchaseProperty;} + {_purchaseProperty = If( json?.PropertyT("purchaseProperties"), out var __jsonPurchaseProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest.FromJson(__jsonPurchaseProperties) : _purchaseProperty;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.PowerShell.cs similarity index 60% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.PowerShell.cs index 5d327a293d08..ffb87c37794e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class PaymentDetail partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PaymentDetail(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PaymentDetail(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,37 +111,37 @@ internal PaymentDetail(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("DueDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).DueDate = (global::System.DateTime?) content.GetValueForProperty("DueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).DueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).DueDate = (global::System.DateTime?) content.GetValueForProperty("DueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).DueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("PaymentDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).PaymentDate = (global::System.DateTime?) content.GetValueForProperty("PaymentDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).PaymentDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).PaymentDate = (global::System.DateTime?) content.GetValueForProperty("PaymentDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).PaymentDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("PricingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).BillingAccount = (string) content.GetValueForProperty("BillingAccount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).BillingAccount, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).BillingAccount = (string) content.GetValueForProperty("BillingAccount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).BillingAccount, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ExtendedStatusInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfoTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfoTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -156,31 +156,31 @@ internal PaymentDetail(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("DueDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).DueDate = (global::System.DateTime?) content.GetValueForProperty("DueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).DueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).DueDate = (global::System.DateTime?) content.GetValueForProperty("DueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).DueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("PaymentDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).PaymentDate = (global::System.DateTime?) content.GetValueForProperty("PaymentDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).PaymentDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).PaymentDate = (global::System.DateTime?) content.GetValueForProperty("PaymentDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).PaymentDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("PricingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).BillingAccount = (string) content.GetValueForProperty("BillingAccount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).BillingAccount, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).BillingAccount = (string) content.GetValueForProperty("BillingAccount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).BillingAccount, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ExtendedStatusInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfoTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfoTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.TypeConverter.cs index c5cb117d9adf..c933b4c31f7c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.cs similarity index 75% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.cs index abaf4434adbc..bc05926bd71b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Information about payment related to a reservation order. public partial class PaymentDetail : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetailInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetailInternal { /// Backing field for property. @@ -22,14 +22,14 @@ public partial class PaymentDetail : public string BillingAccount { get => this._billingAccount; set => this._billingAccount = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyTotal; /// /// Amount charged in Billing currency. Tax not included. Is null for future payments /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyTotal = value; } /// Backing field for property. private global::System.DateTime? _dueDate; @@ -40,11 +40,11 @@ public partial class PaymentDetail : public global::System.DateTime? DueDate { get => this._dueDate; set => this._dueDate = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo _extendedStatusInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo _extendedStatusInfo; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo ExtendedStatusInfo { get => (this._extendedStatusInfo = this._extendedStatusInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfo()); set => this._extendedStatusInfo = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo ExtendedStatusInfo { get => (this._extendedStatusInfo = this._extendedStatusInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfo()); set => this._extendedStatusInfo = value; } /// Backing field for property. private global::System.DateTime? _paymentDate; @@ -55,22 +55,22 @@ public partial class PaymentDetail : public global::System.DateTime? PaymentDate { get => this._paymentDate; set => this._paymentDate = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _pricingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _pricingCurrencyTotal; /// Amount in pricing currency. Tax not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingCurrencyTotal { get => (this._pricingCurrencyTotal = this._pricingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._pricingCurrencyTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingCurrencyTotal { get => (this._pricingCurrencyTotal = this._pricingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._pricingCurrencyTotal = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus? _status; + private string _status; /// /// Describes whether the payment is completed, failed, cancelled or scheduled in the future. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 2)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Creates an new instance. public PaymentDetail() @@ -86,6 +86,9 @@ public partial interface IPaymentDetail : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Shows the Account that is charged for this payment.", SerializedName = @"billingAccount", PossibleTypes = new [] { typeof(string) })] @@ -96,14 +99,20 @@ public partial interface IPaymentDetail : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount charged in Billing currency. Tax not included. Is null for future payments", SerializedName = @"billingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get; set; } /// Date when the payment needs to be done. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date when the payment needs to be done.", SerializedName = @"dueDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -112,14 +121,20 @@ public partial interface IPaymentDetail : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"extendedStatusInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo ExtendedStatusInfo { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo ExtendedStatusInfo { get; set; } /// Date when the transaction is completed. Is null when it is scheduled. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date when the transaction is completed. Is null when it is scheduled.", SerializedName = @"paymentDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -128,20 +143,27 @@ public partial interface IPaymentDetail : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount in pricing currency. Tax not included.", SerializedName = @"pricingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingCurrencyTotal { get; set; } /// /// Describes whether the payment is completed, failed, cancelled or scheduled in the future. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Describes whether the payment is completed, failed, cancelled or scheduled in the future.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Scheduled", "Cancelled")] + string Status { get; set; } } /// Information about payment related to a reservation order. @@ -153,19 +175,20 @@ internal partial interface IPaymentDetailInternal /// /// Amount charged in Billing currency. Tax not included. Is null for future payments /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get; set; } /// Date when the payment needs to be done. global::System.DateTime? DueDate { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo ExtendedStatusInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo ExtendedStatusInfo { get; set; } /// Date when the transaction is completed. Is null when it is scheduled. global::System.DateTime? PaymentDate { get; set; } /// Amount in pricing currency. Tax not included. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingCurrencyTotal { get; set; } /// /// Describes whether the payment is completed, failed, cancelled or scheduled in the future. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Scheduled", "Cancelled")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.json.cs similarity index 91% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.json.cs index b6c6179918e4..a607fea3094e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PaymentDetail.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PaymentDetail.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PaymentDetail partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new PaymentDetail(json) : null; } @@ -77,13 +77,13 @@ internal PaymentDetail(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.J { return; } - {_dueDate = If( json?.PropertyT("dueDate"), out var __jsonDueDate) ? global::System.DateTime.TryParse((string)__jsonDueDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDueDateValue) ? __jsonDueDateValue : DueDate : DueDate;} - {_paymentDate = If( json?.PropertyT("paymentDate"), out var __jsonPaymentDate) ? global::System.DateTime.TryParse((string)__jsonPaymentDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPaymentDateValue) ? __jsonPaymentDateValue : PaymentDate : PaymentDate;} - {_pricingCurrencyTotal = If( json?.PropertyT("pricingCurrencyTotal"), out var __jsonPricingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonPricingCurrencyTotal) : PricingCurrencyTotal;} - {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyTotal) : BillingCurrencyTotal;} - {_billingAccount = If( json?.PropertyT("billingAccount"), out var __jsonBillingAccount) ? (string)__jsonBillingAccount : (string)BillingAccount;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_extendedStatusInfo = If( json?.PropertyT("extendedStatusInfo"), out var __jsonExtendedStatusInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfo.FromJson(__jsonExtendedStatusInfo) : ExtendedStatusInfo;} + {_dueDate = If( json?.PropertyT("dueDate"), out var __jsonDueDate) ? global::System.DateTime.TryParse((string)__jsonDueDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDueDateValue) ? __jsonDueDateValue : _dueDate : _dueDate;} + {_paymentDate = If( json?.PropertyT("paymentDate"), out var __jsonPaymentDate) ? global::System.DateTime.TryParse((string)__jsonPaymentDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPaymentDateValue) ? __jsonPaymentDateValue : _paymentDate : _paymentDate;} + {_pricingCurrencyTotal = If( json?.PropertyT("pricingCurrencyTotal"), out var __jsonPricingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonPricingCurrencyTotal) : _pricingCurrencyTotal;} + {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyTotal) : _billingCurrencyTotal;} + {_billingAccount = If( json?.PropertyT("billingAccount"), out var __jsonBillingAccount) ? (string)__jsonBillingAccount : (string)_billingAccount;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_extendedStatusInfo = If( json?.PropertyT("extendedStatusInfo"), out var __jsonExtendedStatusInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfo.FromJson(__jsonExtendedStatusInfo) : _extendedStatusInfo;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Price.PowerShell.cs similarity index 81% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Price.PowerShell.cs index b7072aceef65..dd2051a9bf6f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Price.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Price partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Price(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Price(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal Price(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal Price(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).Amount = (double?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)this).Amount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Price.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Price.TypeConverter.cs index 2c610a7e71a8..ac8b53c3b5e6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Price.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Price.cs similarity index 91% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Price.cs index 3d44759cd798..3a1b16b9e6b4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Price.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Pricing information containing the amount and the currency code public partial class Price : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IPrice : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"amount", PossibleTypes = new [] { typeof(double) })] @@ -51,6 +54,9 @@ public partial interface IPrice : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Price.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Price.json.cs index f1d3b030a2c2..5cac72e98976 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/Price.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Price.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Price partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice. + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new Price(json) : null; } @@ -77,8 +75,8 @@ internal Price(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.Json { return; } - {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)CurrencyCode;} - {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (double?)__jsonAmount : Amount;} + {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)_currencyCode;} + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (double?)__jsonAmount : _amount;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.PowerShell.cs similarity index 60% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.PowerShell.cs index 74f5f6f82083..ea6bfb8977c8 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class ProxyResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ProxyResource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ProxyResource(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProx /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,49 +113,49 @@ internal ProxyResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -170,43 +170,43 @@ internal ProxyResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs index 49961d908ac2..21f591110747 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProxyResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProxyResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.cs similarity index 50% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.cs index 1c8cb7b8a21e..f9fa983de833 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -11,73 +11,90 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40 /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location /// public partial class ProxyResource : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProxyResource, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProxyResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Resource(); /// /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemData = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemData = value; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataCreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataCreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataCreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataLastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataLastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataLastModifiedByType = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).Type = value; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).Name; } /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemData; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataCreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataCreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataCreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public ProxyResource() @@ -100,13 +117,13 @@ public ProxyResource() /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location public partial interface IProxyResource : Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource { } /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location internal partial interface IProxyResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal { } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.json.cs similarity index 95% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.json.cs index 25e4a78980a1..3cbfb67b040d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/ProxyResource.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ProxyResource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ProxyResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProxyResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProxyResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; } @@ -79,7 +79,7 @@ internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.J { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.Resource(json); + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Resource(json); AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.PowerShell.cs new file mode 100644 index 000000000000..3f38afed3206 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.PowerShell.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// The request for reservation purchase + [System.ComponentModel.TypeConverter(typeof(PurchaseRequestTypeConverter))] + public partial class PurchaseRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PurchaseRequest(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.Reservations.Models.IPurchaseRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PurchaseRequest(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.Reservations.Models.IPurchaseRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PurchaseRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InternalSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("Properties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopes")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopes = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceProperties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReservedResourceProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReservedResourceProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).InstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId, 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 PurchaseRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InternalSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("Properties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Sku = (string) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Sku, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopes")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopes = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceProperties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReservedResourceProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReservedResourceProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).InstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId, 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The request for reservation purchase + [System.ComponentModel.TypeConverter(typeof(PurchaseRequestTypeConverter))] + public partial interface IPurchaseRequest + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.TypeConverter.cs index 3ef6f6af4ebe..904779b616f0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.cs similarity index 60% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.cs index f5f38d4e1ae3..60a7c388b7f4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.cs @@ -3,74 +3,74 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The request for reservation purchase public partial class PurchaseRequest : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal { /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyDisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyDisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertySubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertySubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyTenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyTenantId = value ?? null; } /// Type of the Applied Scope. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopeType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); } + public string AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopeType = value ?? null; } /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string[] AppliedScopes { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopes; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopes = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AppliedScopes { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopes; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopes = value ?? null /* arrayOf */; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).BillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); } + public string BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).BillingPlan = value ?? null; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).BillingScopeId = value ?? null; } + public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).BillingScopeId = value ?? null; } /// Friendly name of the reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).DisplayName = value ?? null; } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).ReservedResourcePropertyInstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).ReservedResourcePropertyInstanceFlexibility = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); } + public string InstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).ReservedResourcePropertyInstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).ReservedResourcePropertyInstanceFlexibility = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName _internalSkuName; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName _internalSkuName; /// The name of sku [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName()); set => this._internalSkuName = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName()); set => this._internalSkuName = value; } /// Backing field for property. private string _location; @@ -80,48 +80,48 @@ public partial class PurchaseRequest : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).AppliedScopeProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).AppliedScopeProperty = value; } /// Internal Acessors for InternalSkuName - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal.InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName()); set { {_internalSkuName = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal.InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName()); set { {_internalSkuName = value;} } } /// Internal Acessors for Properties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal.Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestProperties()); set { {_properties = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal.Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestProperties()); set { {_properties = value;} } } /// Internal Acessors for ReservedResourceProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal.ReservedResourceProperties { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).ReservedResourceProperties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).ReservedResourceProperties = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal.ReservedResourceProperties { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).ReservedResourceProperties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).ReservedResourceProperties = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties _properties; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties _properties; /// Properties of reservation purchase request [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestProperties()); set => this._properties = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestProperties()); set => this._properties = value; } /// Quantity of the skus that are part of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).Quantity = value ?? default(int); } + public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).Quantity = value ?? default(int); } /// /// Setting this to true will automatically purchase a new reservation on the expiration date time. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public bool? Renew { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).Renew; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).Renew = value ?? default(bool); } + public bool? Renew { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).Renew; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).Renew = value ?? default(bool); } /// The type of the resource that is being reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).ReservedResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).ReservedResourceType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType)""); } + public string ReservedResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).ReservedResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).ReservedResourceType = value ?? null; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).ReviewDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).ReviewDateTime = value ?? default(global::System.DateTime); } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal)InternalSkuName).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal)InternalSkuName).Name = value ?? null; } + public string Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal)InternalSkuName).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal)InternalSkuName).Name = value ?? null; } /// Represent the term of reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal)Properties).Term = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm)""); } + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)Properties).Term = value ?? null; } /// Creates an new instance. public PurchaseRequest() @@ -137,6 +137,9 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -147,6 +150,9 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -155,6 +161,9 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +172,9 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -171,6 +183,9 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -179,10 +194,14 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. @@ -190,22 +209,32 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - string[] AppliedScopes { get; set; } + System.Collections.Generic.List AppliedScopes { get; set; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription that will be charged for purchasing reservation or savings plan", SerializedName = @"billingScopeId", PossibleTypes = new [] { typeof(string) })] @@ -214,6 +243,9 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name of the reservation", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -225,14 +257,21 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } /// The Azure region where the reserved resource lives. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The Azure region where the reserved resource lives.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -241,6 +280,9 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity of the skus that are part of the reservation.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -251,6 +293,9 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Setting this to true will automatically purchase a new reservation on the expiration date time.", SerializedName = @"renew", PossibleTypes = new [] { typeof(bool) })] @@ -259,14 +304,21 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the resource that is being reserved.", SerializedName = @"reservedResourceType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the Azure hybrid benefit needs to be reviewed.", SerializedName = @"reviewDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -275,6 +327,9 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -283,10 +338,14 @@ public partial interface IPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } } /// The request for reservation purchase @@ -297,7 +356,7 @@ internal partial interface IPurchaseRequestInternal /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -311,14 +370,16 @@ internal partial interface IPurchaseRequestInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// Type of the Applied Scope. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// - string[] AppliedScopes { get; set; } + System.Collections.Generic.List AppliedScopes { get; set; } /// Represent the billing plans. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan string BillingScopeId { get; set; } /// Friendly name of the reservation @@ -327,13 +388,14 @@ internal partial interface IPurchaseRequestInternal /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } /// The name of sku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName InternalSkuName { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName InternalSkuName { get; set; } /// The Azure region where the reserved resource lives. string Location { get; set; } /// Properties of reservation purchase request - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties Properties { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties Properties { get; set; } /// Quantity of the skus that are part of the reservation. int? Quantity { get; set; } /// @@ -343,15 +405,17 @@ internal partial interface IPurchaseRequestInternal /// /// Properties specific to each reserved resource type. Not required if not applicable. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties ReservedResourceProperties { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties ReservedResourceProperties { get; set; } /// The type of the resource that is being reserved. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. global::System.DateTime? ReviewDateTime { get; set; } string Sku { get; set; } /// Represent the term of reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.json.cs similarity index 87% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.json.cs index ccde664a78f5..a58815a28b4b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequest.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PurchaseRequest partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new PurchaseRequest(json) : null; } @@ -77,9 +77,9 @@ internal PurchaseRequest(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime { return; } - {_internalSkuName = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName.FromJson(__jsonSku) : InternalSkuName;} - {_properties = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestProperties.FromJson(__jsonProperties) : Properties;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_internalSkuName = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName.FromJson(__jsonSku) : _internalSkuName;} + {_properties = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestProperties.FromJson(__jsonProperties) : _properties;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} AfterFromJson(json); } @@ -104,7 +104,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ } AddIf( null != this._internalSkuName ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._internalSkuName.ToJson(null,serializationMode) : null, "sku" ,container.Add ); AddIf( null != this._properties ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._properties.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.PowerShell.cs new file mode 100644 index 000000000000..37aac3fa5342 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// Properties of reservation purchase request + [System.ComponentModel.TypeConverter(typeof(PurchaseRequestPropertiesTypeConverter))] + public partial class PurchaseRequestProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PurchaseRequestProperties(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.Reservations.Models.IPurchaseRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PurchaseRequestProperties(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.Reservations.Models.IPurchaseRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PurchaseRequestProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceProperties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourceProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourceProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopes")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopes = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourcePropertyInstanceFlexibility = (string) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourcePropertyInstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId, 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 PurchaseRequestProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceProperties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourceProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourceProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopes")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopes = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourcePropertyInstanceFlexibility = (string) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).ReservedResourcePropertyInstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId, 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Properties of reservation purchase request + [System.ComponentModel.TypeConverter(typeof(PurchaseRequestPropertiesTypeConverter))] + public partial interface IPurchaseRequestProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.TypeConverter.cs index 224a0def86c9..df873e18ddd9 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.cs similarity index 67% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.cs index 40695f08f0a4..d35502d52f57 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.cs @@ -3,71 +3,71 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties of reservation purchase request public partial class PurchaseRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties _appliedScopeProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties _appliedScopeProperty; /// /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties()); set => this._appliedScopeProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties()); set => this._appliedScopeProperty = value; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? _appliedScopeType; + private string _appliedScopeType; /// Type of the Applied Scope. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => this._appliedScopeType; set => this._appliedScopeType = value; } + public string AppliedScopeType { get => this._appliedScopeType; set => this._appliedScopeType = value; } /// Backing field for property. - private string[] _appliedScopes; + private System.Collections.Generic.List _appliedScopes; /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public string[] AppliedScopes { get => this._appliedScopes; set => this._appliedScopes = value; } + public System.Collections.Generic.List AppliedScopes { get => this._appliedScopes; set => this._appliedScopes = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? _billingPlan; + private string _billingPlan; /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get => this._billingPlan; set => this._billingPlan = value; } + public string BillingPlan { get => this._billingPlan; set => this._billingPlan = value; } /// Backing field for property. private string _billingScopeId; @@ -84,10 +84,10 @@ public partial class PurchaseRequestProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal.AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties()); set { {_appliedScopeProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal.AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties()); set { {_appliedScopeProperty = value;} } } /// Internal Acessors for ReservedResourceProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesInternal.ReservedResourceProperties { get => (this._reservedResourceProperties = this._reservedResourceProperties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourceProperties()); set { {_reservedResourceProperties = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesInternal.ReservedResourceProperties { get => (this._reservedResourceProperties = this._reservedResourceProperties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourceProperties()); set { {_reservedResourceProperties = value;} } } /// Backing field for property. private int? _quantity; @@ -106,27 +106,27 @@ public partial class PurchaseRequestProperties : public bool? Renew { get => this._renew; set => this._renew = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties _reservedResourceProperties; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties _reservedResourceProperties; /// /// Properties specific to each reserved resource type. Not required if not applicable. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties ReservedResourceProperties { get => (this._reservedResourceProperties = this._reservedResourceProperties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourceProperties()); set => this._reservedResourceProperties = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties ReservedResourceProperties { get => (this._reservedResourceProperties = this._reservedResourceProperties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourceProperties()); set => this._reservedResourceProperties = value; } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? ReservedResourcePropertyInstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)ReservedResourceProperties).InstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)ReservedResourceProperties).InstanceFlexibility = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); } + public string ReservedResourcePropertyInstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)ReservedResourceProperties).InstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)ReservedResourceProperties).InstanceFlexibility = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? _reservedResourceType; + private string _reservedResourceType; /// The type of the resource that is being reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get => this._reservedResourceType; set => this._reservedResourceType = value; } + public string ReservedResourceType { get => this._reservedResourceType; set => this._reservedResourceType = value; } /// Backing field for property. private global::System.DateTime? _reviewDateTime; @@ -136,11 +136,11 @@ public partial class PurchaseRequestProperties : public global::System.DateTime? ReviewDateTime { get => this._reviewDateTime; set => this._reviewDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? _term; + private string _term; /// Represent the term of reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get => this._term; set => this._term = value; } + public string Term { get => this._term; set => this._term = value; } /// Creates an new instance. public PurchaseRequestProperties() @@ -156,6 +156,9 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -166,6 +169,9 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -174,6 +180,9 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -182,6 +191,9 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -190,6 +202,9 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -198,10 +213,14 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. @@ -209,22 +228,32 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - string[] AppliedScopes { get; set; } + System.Collections.Generic.List AppliedScopes { get; set; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription that will be charged for purchasing reservation or savings plan", SerializedName = @"billingScopeId", PossibleTypes = new [] { typeof(string) })] @@ -233,6 +262,9 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name of the reservation", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -241,6 +273,9 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity of the skus that are part of the reservation.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -251,6 +286,9 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Setting this to true will automatically purchase a new reservation on the expiration date time.", SerializedName = @"renew", PossibleTypes = new [] { typeof(bool) })] @@ -262,22 +300,33 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? ReservedResourcePropertyInstanceFlexibility { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string ReservedResourcePropertyInstanceFlexibility { get; set; } /// The type of the resource that is being reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the resource that is being reserved.", SerializedName = @"reservedResourceType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the Azure hybrid benefit needs to be reviewed.", SerializedName = @"reviewDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -286,10 +335,14 @@ public partial interface IPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } } /// Properties of reservation purchase request @@ -300,7 +353,7 @@ internal partial interface IPurchaseRequestPropertiesInternal /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -314,14 +367,16 @@ internal partial interface IPurchaseRequestPropertiesInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// Type of the Applied Scope. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// - string[] AppliedScopes { get; set; } + System.Collections.Generic.List AppliedScopes { get; set; } /// Represent the billing plans. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan string BillingScopeId { get; set; } /// Friendly name of the reservation @@ -335,18 +390,21 @@ internal partial interface IPurchaseRequestPropertiesInternal /// /// Properties specific to each reserved resource type. Not required if not applicable. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties ReservedResourceProperties { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties ReservedResourceProperties { get; set; } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? ReservedResourcePropertyInstanceFlexibility { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string ReservedResourcePropertyInstanceFlexibility { get; set; } /// The type of the resource that is being reserved. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. global::System.DateTime? ReviewDateTime { get; set; } /// Represent the term of reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.json.cs index c9c88cbf3e2b..7699815a5fc1 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PurchaseRequestProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new PurchaseRequestProperties(json) : null; } @@ -77,18 +77,18 @@ internal PurchaseRequestProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservatio { return; } - {_appliedScopeProperty = If( json?.PropertyT("appliedScopeProperties"), out var __jsonAppliedScopeProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties.FromJson(__jsonAppliedScopeProperties) : AppliedScopeProperty;} - {_reservedResourceProperties = If( json?.PropertyT("reservedResourceProperties"), out var __jsonReservedResourceProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestPropertiesReservedResourceProperties.FromJson(__jsonReservedResourceProperties) : ReservedResourceProperties;} - {_reservedResourceType = If( json?.PropertyT("reservedResourceType"), out var __jsonReservedResourceType) ? (string)__jsonReservedResourceType : (string)ReservedResourceType;} - {_billingScopeId = If( json?.PropertyT("billingScopeId"), out var __jsonBillingScopeId) ? (string)__jsonBillingScopeId : (string)BillingScopeId;} - {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)Term;} - {_billingPlan = If( json?.PropertyT("billingPlan"), out var __jsonBillingPlan) ? (string)__jsonBillingPlan : (string)BillingPlan;} - {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : Quantity;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_appliedScopeType = If( json?.PropertyT("appliedScopeType"), out var __jsonAppliedScopeType) ? (string)__jsonAppliedScopeType : (string)AppliedScopeType;} - {_appliedScopes = If( json?.PropertyT("appliedScopes"), out var __jsonAppliedScopes) ? If( __jsonAppliedScopes as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AppliedScopes;} - {_renew = If( json?.PropertyT("renew"), out var __jsonRenew) ? (bool?)__jsonRenew : Renew;} - {_reviewDateTime = If( json?.PropertyT("reviewDateTime"), out var __jsonReviewDateTime) ? global::System.DateTime.TryParse((string)__jsonReviewDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReviewDateTimeValue) ? __jsonReviewDateTimeValue : ReviewDateTime : ReviewDateTime;} + {_appliedScopeProperty = If( json?.PropertyT("appliedScopeProperties"), out var __jsonAppliedScopeProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties.FromJson(__jsonAppliedScopeProperties) : _appliedScopeProperty;} + {_reservedResourceProperties = If( json?.PropertyT("reservedResourceProperties"), out var __jsonReservedResourceProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourceProperties.FromJson(__jsonReservedResourceProperties) : _reservedResourceProperties;} + {_reservedResourceType = If( json?.PropertyT("reservedResourceType"), out var __jsonReservedResourceType) ? (string)__jsonReservedResourceType : (string)_reservedResourceType;} + {_billingScopeId = If( json?.PropertyT("billingScopeId"), out var __jsonBillingScopeId) ? (string)__jsonBillingScopeId : (string)_billingScopeId;} + {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)_term;} + {_billingPlan = If( json?.PropertyT("billingPlan"), out var __jsonBillingPlan) ? (string)__jsonBillingPlan : (string)_billingPlan;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : _quantity;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_appliedScopeType = If( json?.PropertyT("appliedScopeType"), out var __jsonAppliedScopeType) ? (string)__jsonAppliedScopeType : (string)_appliedScopeType;} + {_appliedScopes = If( json?.PropertyT("appliedScopes"), out var __jsonAppliedScopes) ? If( __jsonAppliedScopes as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _appliedScopes;} + {_renew = If( json?.PropertyT("renew"), out var __jsonRenew) ? (bool?)__jsonRenew : _renew;} + {_reviewDateTime = If( json?.PropertyT("reviewDateTime"), out var __jsonReviewDateTime) ? global::System.DateTime.TryParse((string)__jsonReviewDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReviewDateTimeValue) ? __jsonReviewDateTimeValue : _reviewDateTime : _reviewDateTime;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.PowerShell.cs similarity index 80% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.PowerShell.cs index 846f55bf54d3..cc50917f6857 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class PurchaseRequestPropertiesReservedResourceProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PurchaseRequestPropertiesReservedResourceProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PurchaseRequestPropertiesReservedResourceProperties(content); } @@ -100,10 +100,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -118,13 +118,13 @@ internal PurchaseRequestPropertiesReservedResourceProperties(global::System.Coll // actually deserialize if (content.Contains("InstanceFlexibility")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)this).InstanceFlexibility, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -139,7 +139,7 @@ internal PurchaseRequestPropertiesReservedResourceProperties(global::System.Mana // actually deserialize if (content.Contains("InstanceFlexibility")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)this).InstanceFlexibility = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility?) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)this).InstanceFlexibility, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourcePropertiesInternal)this).InstanceFlexibility, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.TypeConverter.cs index 14ed0e8a93b4..d5912f324e4c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -112,14 +112,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// an instance of , or null if there is no suitable /// conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.cs similarity index 73% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.cs index 19c7b8729ae9..fbc30d40d491 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -11,19 +11,19 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// Properties specific to each reserved resource type. Not required if not applicable. /// public partial class PurchaseRequestPropertiesReservedResourceProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourcePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourcePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? _instanceFlexibility; + private string _instanceFlexibility; /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get => this._instanceFlexibility; set => this._instanceFlexibility = value; } + public string InstanceFlexibility { get => this._instanceFlexibility; set => this._instanceFlexibility = value; } /// /// Creates an new instance. @@ -44,10 +44,14 @@ public partial interface IPurchaseRequestPropertiesReservedResourceProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } } /// Properties specific to each reserved resource type. Not required if not applicable. @@ -58,7 +62,8 @@ internal partial interface IPurchaseRequestPropertiesReservedResourcePropertiesI /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.json.cs index 8c0123c07ed3..5dcc3f21a870 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/PurchaseRequestPropertiesReservedResourceProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/PurchaseRequestPropertiesReservedResourceProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class PurchaseRequestPropertiesReservedResourceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new PurchaseRequestPropertiesReservedResourceProperties(json) : null; } @@ -80,7 +80,7 @@ internal PurchaseRequestPropertiesReservedResourceProperties(Microsoft.Azure.Pow { return; } - {_instanceFlexibility = If( json?.PropertyT("instanceFlexibility"), out var __jsonInstanceFlexibility) ? (string)__jsonInstanceFlexibility : (string)InstanceFlexibility;} + {_instanceFlexibility = If( json?.PropertyT("instanceFlexibility"), out var __jsonInstanceFlexibility) ? (string)__jsonInstanceFlexibility : (string)_instanceFlexibility;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.PowerShell.cs similarity index 61% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.PowerShell.cs index c5f186d4e28e..80a11cddd7a0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class RefundBillingInformation partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RefundBillingInformation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RefundBillingInformation(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,33 +111,33 @@ internal RefundBillingInformation(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("BillingPlan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingPlan, global::System.Convert.ToString); } if (content.Contains("CompletedTransaction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).CompletedTransaction = (int?) content.GetValueForProperty("CompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).CompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).CompletedTransaction = (int?) content.GetValueForProperty("CompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).CompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("TotalTransaction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).TotalTransaction = (int?) content.GetValueForProperty("TotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).TotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).TotalTransaction = (int?) content.GetValueForProperty("TotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).TotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("BillingCurrencyTotalPaidAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyProratedAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyRemainingCommitmentAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -154,27 +152,27 @@ internal RefundBillingInformation(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("BillingPlan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingPlan, global::System.Convert.ToString); } if (content.Contains("CompletedTransaction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).CompletedTransaction = (int?) content.GetValueForProperty("CompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).CompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).CompletedTransaction = (int?) content.GetValueForProperty("CompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).CompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("TotalTransaction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).TotalTransaction = (int?) content.GetValueForProperty("TotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).TotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).TotalTransaction = (int?) content.GetValueForProperty("TotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).TotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("BillingCurrencyTotalPaidAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyProratedAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyRemainingCommitmentAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)this).BillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.TypeConverter.cs index abf2e56603bc..117641f7cb6f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.cs similarity index 70% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.cs index 2f46ef1860e7..c42ec8b35077 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.cs @@ -3,45 +3,45 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// billing information public partial class RefundBillingInformation : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyProratedAmount; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyProratedAmount; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyProratedAmount { get => (this._billingCurrencyProratedAmount = this._billingCurrencyProratedAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyProratedAmount = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyProratedAmount { get => (this._billingCurrencyProratedAmount = this._billingCurrencyProratedAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyProratedAmount = value; } /// /// Backing field for property. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyRemainingCommitmentAmount; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyRemainingCommitmentAmount; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyRemainingCommitmentAmount { get => (this._billingCurrencyRemainingCommitmentAmount = this._billingCurrencyRemainingCommitmentAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyRemainingCommitmentAmount = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyRemainingCommitmentAmount { get => (this._billingCurrencyRemainingCommitmentAmount = this._billingCurrencyRemainingCommitmentAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyRemainingCommitmentAmount = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyTotalPaidAmount; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyTotalPaidAmount; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotalPaidAmount { get => (this._billingCurrencyTotalPaidAmount = this._billingCurrencyTotalPaidAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyTotalPaidAmount = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotalPaidAmount { get => (this._billingCurrencyTotalPaidAmount = this._billingCurrencyTotalPaidAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyTotalPaidAmount = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? _billingPlan; + private string _billingPlan; /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get => this._billingPlan; set => this._billingPlan = value; } + public string BillingPlan { get => this._billingPlan; set => this._billingPlan = value; } /// Backing field for property. private int? _completedTransaction; @@ -71,38 +71,54 @@ public partial interface IRefundBillingInformation : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyProratedAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyProratedAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyProratedAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyRemainingCommitmentAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyRemainingCommitmentAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyRemainingCommitmentAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyTotalPaidAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotalPaidAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotalPaidAmount { get; set; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// The number of completed transactions in this reservation's payment [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of completed transactions in this reservation's payment", SerializedName = @"completedTransactions", PossibleTypes = new [] { typeof(int) })] @@ -111,6 +127,9 @@ public partial interface IRefundBillingInformation : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of total transactions in this reservation's payment", SerializedName = @"totalTransactions", PossibleTypes = new [] { typeof(int) })] @@ -122,13 +141,14 @@ internal partial interface IRefundBillingInformationInternal { /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyProratedAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyProratedAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyRemainingCommitmentAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyRemainingCommitmentAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotalPaidAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotalPaidAmount { get; set; } /// Represent the billing plans. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// The number of completed transactions in this reservation's payment int? CompletedTransaction { get; set; } /// The number of total transactions in this reservation's payment diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.json.cs similarity index 91% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.json.cs index 521fb253d002..a3bfc0b00e39 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundBillingInformation.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundBillingInformation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RefundBillingInformation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RefundBillingInformation(json) : null; } @@ -77,12 +77,12 @@ internal RefundBillingInformation(Microsoft.Azure.PowerShell.Cmdlets.Reservation { return; } - {_billingPlan = If( json?.PropertyT("billingPlan"), out var __jsonBillingPlan) ? (string)__jsonBillingPlan : (string)BillingPlan;} - {_completedTransaction = If( json?.PropertyT("completedTransactions"), out var __jsonCompletedTransactions) ? (int?)__jsonCompletedTransactions : CompletedTransaction;} - {_totalTransaction = If( json?.PropertyT("totalTransactions"), out var __jsonTotalTransactions) ? (int?)__jsonTotalTransactions : TotalTransaction;} - {_billingCurrencyTotalPaidAmount = If( json?.PropertyT("billingCurrencyTotalPaidAmount"), out var __jsonBillingCurrencyTotalPaidAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyTotalPaidAmount) : BillingCurrencyTotalPaidAmount;} - {_billingCurrencyProratedAmount = If( json?.PropertyT("billingCurrencyProratedAmount"), out var __jsonBillingCurrencyProratedAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyProratedAmount) : BillingCurrencyProratedAmount;} - {_billingCurrencyRemainingCommitmentAmount = If( json?.PropertyT("billingCurrencyRemainingCommitmentAmount"), out var __jsonBillingCurrencyRemainingCommitmentAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyRemainingCommitmentAmount) : BillingCurrencyRemainingCommitmentAmount;} + {_billingPlan = If( json?.PropertyT("billingPlan"), out var __jsonBillingPlan) ? (string)__jsonBillingPlan : (string)_billingPlan;} + {_completedTransaction = If( json?.PropertyT("completedTransactions"), out var __jsonCompletedTransactions) ? (int?)__jsonCompletedTransactions : _completedTransaction;} + {_totalTransaction = If( json?.PropertyT("totalTransactions"), out var __jsonTotalTransactions) ? (int?)__jsonTotalTransactions : _totalTransaction;} + {_billingCurrencyTotalPaidAmount = If( json?.PropertyT("billingCurrencyTotalPaidAmount"), out var __jsonBillingCurrencyTotalPaidAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyTotalPaidAmount) : _billingCurrencyTotalPaidAmount;} + {_billingCurrencyProratedAmount = If( json?.PropertyT("billingCurrencyProratedAmount"), out var __jsonBillingCurrencyProratedAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyProratedAmount) : _billingCurrencyProratedAmount;} + {_billingCurrencyRemainingCommitmentAmount = If( json?.PropertyT("billingCurrencyRemainingCommitmentAmount"), out var __jsonBillingCurrencyRemainingCommitmentAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyRemainingCommitmentAmount) : _billingCurrencyRemainingCommitmentAmount;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.PowerShell.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.PowerShell.cs index 7208bff3756e..81c5b1d7a3d7 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class RefundPolicyError partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RefundPolicyError(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RefundPolicyError(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal RefundPolicyError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyErrorInternal)this).Code = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyErrorInternal)this).Code, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal RefundPolicyError(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyErrorInternal)this).Code = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode?) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyErrorInternal)this).Code, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.TypeConverter.cs index 23a5d99a7c1b..3771a0ada9d6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.cs new file mode 100644 index 000000000000..4fcdc67bf53a --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + + /// error details + public partial class RefundPolicyError : + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyErrorInternal + { + + /// Backing field for property. + private string _code; + + /// + /// Error code describing the reason that service is not able to process the incoming request + /// + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public RefundPolicyError() + { + + } + } + /// error details + public partial interface IRefundPolicyError : + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable + { + /// + /// Error code describing the reason that service is not able to process the incoming request + /// + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Error code describing the reason that service is not able to process the incoming request", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("NotSpecified", "InternalServerError", "ServerTimeout", "AuthorizationFailed", "BadRequest", "ClientCertificateThumbprintNotSet", "InvalidRequestContent", "OperationFailed", "HttpMethodNotSupported", "InvalidRequestUri", "MissingTenantId", "InvalidTenantId", "InvalidReservationOrderId", "InvalidReservationId", "ReservationIdNotInReservationOrder", "ReservationOrderNotFound", "InvalidSubscriptionId", "InvalidAccessToken", "InvalidLocationId", "UnauthenticatedRequestsThrottled", "InvalidHealthCheckType", "Forbidden", "BillingScopeIdCannotBeChanged", "AppliedScopesNotAssociatedWithCommerceAccount", "PatchValuesSameAsExisting", "RoleAssignmentCreationFailed", "ReservationOrderCreationFailed", "ReservationOrderNotEnabled", "CapacityUpdateScopesFailed", "UnsupportedReservationTerm", "ReservationOrderIdAlreadyExists", "RiskCheckFailed", "CreateQuoteFailed", "ActivateQuoteFailed", "NonsupportedAccountId", "PaymentInstrumentNotFound", "MissingAppliedScopesForSingle", "NoValidReservationsToReRate", "ReRateOnlyAllowedForEA", "OperationCannotBePerformedInCurrentState", "InvalidSingleAppliedScopesCount", "InvalidFulfillmentRequestParameters", "NotSupportedCountry", "InvalidRefundQuantity", "PurchaseError", "BillingCustomerInputError", "BillingPaymentInstrumentSoftError", "BillingPaymentInstrumentHardError", "BillingTransientError", "BillingError", "FulfillmentConfigurationError", "FulfillmentOutOfStockError", "FulfillmentTransientError", "FulfillmentError", "CalculatePriceFailed", "AppliedScopesSameAsExisting", "SelfServiceRefundNotSupported", "RefundLimitExceeded")] + string Code { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// error details + internal partial interface IRefundPolicyErrorInternal + + { + /// + /// Error code describing the reason that service is not able to process the incoming request + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("NotSpecified", "InternalServerError", "ServerTimeout", "AuthorizationFailed", "BadRequest", "ClientCertificateThumbprintNotSet", "InvalidRequestContent", "OperationFailed", "HttpMethodNotSupported", "InvalidRequestUri", "MissingTenantId", "InvalidTenantId", "InvalidReservationOrderId", "InvalidReservationId", "ReservationIdNotInReservationOrder", "ReservationOrderNotFound", "InvalidSubscriptionId", "InvalidAccessToken", "InvalidLocationId", "UnauthenticatedRequestsThrottled", "InvalidHealthCheckType", "Forbidden", "BillingScopeIdCannotBeChanged", "AppliedScopesNotAssociatedWithCommerceAccount", "PatchValuesSameAsExisting", "RoleAssignmentCreationFailed", "ReservationOrderCreationFailed", "ReservationOrderNotEnabled", "CapacityUpdateScopesFailed", "UnsupportedReservationTerm", "ReservationOrderIdAlreadyExists", "RiskCheckFailed", "CreateQuoteFailed", "ActivateQuoteFailed", "NonsupportedAccountId", "PaymentInstrumentNotFound", "MissingAppliedScopesForSingle", "NoValidReservationsToReRate", "ReRateOnlyAllowedForEA", "OperationCannotBePerformedInCurrentState", "InvalidSingleAppliedScopesCount", "InvalidFulfillmentRequestParameters", "NotSupportedCountry", "InvalidRefundQuantity", "PurchaseError", "BillingCustomerInputError", "BillingPaymentInstrumentSoftError", "BillingPaymentInstrumentHardError", "BillingTransientError", "BillingError", "FulfillmentConfigurationError", "FulfillmentOutOfStockError", "FulfillmentTransientError", "FulfillmentError", "CalculatePriceFailed", "AppliedScopesSameAsExisting", "SelfServiceRefundNotSupported", "RefundLimitExceeded")] + string Code { get; set; } + + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.json.cs index 00f42c898835..1c23186a36c2 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyError.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyError.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RefundPolicyError partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RefundPolicyError(json) : null; } @@ -77,8 +77,8 @@ internal RefundPolicyError(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runti { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.PowerShell.cs similarity index 65% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.PowerShell.cs index 0053fc2f94d1..0a30761faef7 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class RefundPolicyResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RefundPolicyResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RefundPolicyResult(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,25 +111,25 @@ internal RefundPolicyResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultPropertyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultPropertyTypeConverter.ConvertFrom); } if (content.Contains("ConsumedRefundsTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("MaxRefundLimit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("PolicyError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyErrorTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyErrorTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,19 +144,19 @@ internal RefundPolicyResult(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultPropertyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultPropertyTypeConverter.ConvertFrom); } if (content.Contains("ConsumedRefundsTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("MaxRefundLimit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("PolicyError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyErrorTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyErrorTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.TypeConverter.cs index 222b4bd2a81b..13af7213f5ab 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.cs similarity index 54% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.cs index 728b053554a0..a25dcbbbc2aa 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.cs @@ -3,37 +3,37 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Refund policy result public partial class RefundPolicyResult : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal { /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)Property).ConsumedRefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)Property).ConsumedRefundsTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)Property).ConsumedRefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)Property).ConsumedRefundsTotal = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)Property).MaxRefundLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)Property).MaxRefundLimit = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)Property).MaxRefundLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)Property).MaxRefundLimit = value ?? null /* model class */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultProperty()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultProperty()); set { {_property = value;} } } /// Refund Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)Property).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)Property).PolicyError = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)Property).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)Property).PolicyError = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty _property; /// Refund policy result property [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultProperty()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultProperty()); set => this._property = value; } /// Creates an new instance. public RefundPolicyResult() @@ -49,26 +49,35 @@ public partial interface IRefundPolicyResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"consumedRefundsTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"maxRefundLimit", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get; set; } /// Refund Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Refund Policy errors", SerializedName = @"policyErrors", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError) })] + System.Collections.Generic.List PolicyError { get; set; } } /// Refund policy result @@ -76,13 +85,13 @@ internal partial interface IRefundPolicyResultInternal { /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get; set; } /// Refund Policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get; set; } + System.Collections.Generic.List PolicyError { get; set; } /// Refund policy result property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty Property { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.json.cs index f15e2d6b3c29..7b8a052027e0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResult.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RefundPolicyResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RefundPolicyResult(json) : null; } @@ -77,7 +77,7 @@ internal RefundPolicyResult(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runt { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResultProperty.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultProperty.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.PowerShell.cs similarity index 68% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.PowerShell.cs index 9a30538d5bfc..c8766cf86998 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class RefundPolicyResultProperty partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RefundPolicyResultProperty(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RefundPolicyResultProperty(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,21 +111,21 @@ internal RefundPolicyResultProperty(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("ConsumedRefundsTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("MaxRefundLimit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("PolicyError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyErrorTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyErrorTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -142,15 +140,15 @@ internal RefundPolicyResultProperty(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("ConsumedRefundsTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("MaxRefundLimit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("PolicyError")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).PolicyError = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[]) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyErrorTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyErrorTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.TypeConverter.cs index 04458665d6a9..317c449d6677 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.cs similarity index 64% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.cs index b9e86cb302d1..a55c9498dadb 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.cs @@ -3,36 +3,36 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Refund policy result property public partial class RefundPolicyResultProperty : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultPropertyInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultPropertyInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _consumedRefundsTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _consumedRefundsTotal; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get => (this._consumedRefundsTotal = this._consumedRefundsTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._consumedRefundsTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get => (this._consumedRefundsTotal = this._consumedRefundsTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._consumedRefundsTotal = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _maxRefundLimit; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _maxRefundLimit; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get => (this._maxRefundLimit = this._maxRefundLimit ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._maxRefundLimit = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get => (this._maxRefundLimit = this._maxRefundLimit ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._maxRefundLimit = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] _policyError; + private System.Collections.Generic.List _policyError; /// Refund Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get => this._policyError; set => this._policyError = value; } + public System.Collections.Generic.List PolicyError { get => this._policyError; set => this._policyError = value; } /// Creates an new instance. public RefundPolicyResultProperty() @@ -48,26 +48,35 @@ public partial interface IRefundPolicyResultProperty : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"consumedRefundsTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"maxRefundLimit", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get; set; } /// Refund Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Refund Policy errors", SerializedName = @"policyErrors", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError) })] + System.Collections.Generic.List PolicyError { get; set; } } /// Refund policy result property @@ -75,11 +84,11 @@ internal partial interface IRefundPolicyResultPropertyInternal { /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get; set; } /// Refund Policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get; set; } + System.Collections.Generic.List PolicyError { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.json.cs similarity index 88% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.json.cs index bfab739181ec..063079c59c7f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundPolicyResultProperty.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundPolicyResultProperty.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RefundPolicyResultProperty partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RefundPolicyResultProperty(json) : null; } @@ -77,9 +77,9 @@ internal RefundPolicyResultProperty(Microsoft.Azure.PowerShell.Cmdlets.Reservati { return; } - {_consumedRefundsTotal = If( json?.PropertyT("consumedRefundsTotal"), out var __jsonConsumedRefundsTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonConsumedRefundsTotal) : ConsumedRefundsTotal;} - {_maxRefundLimit = If( json?.PropertyT("maxRefundLimit"), out var __jsonMaxRefundLimit) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonMaxRefundLimit) : MaxRefundLimit;} - {_policyError = If( json?.PropertyT("policyErrors"), out var __jsonPolicyErrors) ? If( __jsonPolicyErrors as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IRefundPolicyError) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyError.FromJson(__u) )) ))() : null : PolicyError;} + {_consumedRefundsTotal = If( json?.PropertyT("consumedRefundsTotal"), out var __jsonConsumedRefundsTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonConsumedRefundsTotal) : _consumedRefundsTotal;} + {_maxRefundLimit = If( json?.PropertyT("maxRefundLimit"), out var __jsonMaxRefundLimit) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonMaxRefundLimit) : _maxRefundLimit;} + {_policyError = If( json?.PropertyT("policyErrors"), out var __jsonPolicyErrors) ? If( __jsonPolicyErrors as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyError.FromJson(__u) )) ))() : null : _policyError;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.PowerShell.cs similarity index 64% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.PowerShell.cs index d7f942dedaef..694978be81a8 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class RefundRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RefundRequest(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RefundRequest(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,37 +111,37 @@ internal RefundRequest(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ReservationToReturn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom); } if (content.Contains("SessionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).SessionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).SessionId, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("ReturnReason")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReturnReason = (string) content.GetValueForProperty("ReturnReason",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReturnReason, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReturnReason = (string) content.GetValueForProperty("ReturnReason",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReturnReason, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnQuantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -156,31 +156,31 @@ internal RefundRequest(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("ReservationToReturn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom); } if (content.Contains("SessionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).SessionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).SessionId, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("ReturnReason")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReturnReason = (string) content.GetValueForProperty("ReturnReason",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReturnReason, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReturnReason = (string) content.GetValueForProperty("ReturnReason",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReturnReason, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnQuantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.TypeConverter.cs index 3a5e059d60be..f2f8d89f7949 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.cs similarity index 67% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.cs index 21f3193ea08d..0656e36c37ce 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.cs @@ -3,51 +3,51 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Request containing information needed for returning reservation. public partial class RefundRequest : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal { /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundRequestProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundRequestProperties()); set { {_property = value;} } } /// Internal Acessors for ReservationToReturn - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestInternal.ReservationToReturn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).ReservationToReturn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).ReservationToReturn = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestInternal.ReservationToReturn { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).ReservationToReturn; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).ReservationToReturn = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties _property; /// /// Properties needed for refund request including the session id from calculate refund, the scope, the reservation to be /// returned and the return reason. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundRequestProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundRequestProperties()); set => this._property = value; } /// Quantity to be returned. Must be greater than zero. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? ReservationToReturnQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).ReservationToReturnQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).ReservationToReturnQuantity = value ?? default(int); } + public int? ReservationToReturnQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).ReservationToReturnQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).ReservationToReturnQuantity = value ?? default(int); } /// Fully qualified identifier of the reservation being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationToReturnReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).ReservationToReturnReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).ReservationToReturnReservationId = value ?? null; } + public string ReservationToReturnReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).ReservationToReturnReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).ReservationToReturnReservationId = value ?? null; } /// The reason of returning the reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReturnReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).ReturnReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).ReturnReason = value ?? null; } + public string ReturnReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).ReturnReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).ReturnReason = value ?? null; } /// The scope of the refund, e.g. Reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).Scope = value ?? null; } + public string Scope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).Scope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).Scope = value ?? null; } /// SessionId that was returned by CalculateRefund API. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)Property).SessionId = value ?? null; } + public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)Property).SessionId = value ?? null; } /// Creates an new instance. public RefundRequest() @@ -63,6 +63,9 @@ public partial interface IRefundRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity to be returned. Must be greater than zero.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -71,6 +74,9 @@ public partial interface IRefundRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified identifier of the reservation being returned", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +85,9 @@ public partial interface IRefundRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason of returning the reservation", SerializedName = @"returnReason", PossibleTypes = new [] { typeof(string) })] @@ -87,6 +96,9 @@ public partial interface IRefundRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The scope of the refund, e.g. Reservation", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -95,6 +107,9 @@ public partial interface IRefundRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"SessionId that was returned by CalculateRefund API.", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] @@ -109,9 +124,9 @@ internal partial interface IRefundRequestInternal /// Properties needed for refund request including the session id from calculate refund, the scope, the reservation to be /// returned and the return reason. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties Property { get; set; } /// Reservation to return - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn ReservationToReturn { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn ReservationToReturn { get; set; } /// Quantity to be returned. Must be greater than zero. int? ReservationToReturnQuantity { get; set; } /// Fully qualified identifier of the reservation being returned diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.json.cs index 96c6889b404d..5404ccafd909 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequest.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RefundRequest partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RefundRequest(json) : null; } @@ -77,7 +77,7 @@ internal RefundRequest(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.J { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundRequestProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundRequestProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.PowerShell.cs similarity index 66% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.PowerShell.cs index b9bf0bf86b9d..13e806589d2a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -66,29 +66,27 @@ public partial class RefundRequestProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RefundRequestProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RefundRequestProperties(content); } @@ -98,10 +96,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -116,33 +114,33 @@ internal RefundRequestProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ReservationToReturn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom); } if (content.Contains("SessionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).SessionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).SessionId, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("ReturnReason")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReturnReason = (string) content.GetValueForProperty("ReturnReason",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReturnReason, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReturnReason = (string) content.GetValueForProperty("ReturnReason",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReturnReason, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnQuantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -157,27 +155,27 @@ internal RefundRequestProperties(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("ReservationToReturn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturnTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturn = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) content.GetValueForProperty("ReservationToReturn",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturn, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturnTypeConverter.ConvertFrom); } if (content.Contains("SessionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).SessionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).SessionId, global::System.Convert.ToString); } if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("ReturnReason")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReturnReason = (string) content.GetValueForProperty("ReturnReason",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReturnReason, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReturnReason = (string) content.GetValueForProperty("ReturnReason",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReturnReason, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturnReservationId = (string) content.GetValueForProperty("ReservationToReturnReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturnReservationId, global::System.Convert.ToString); } if (content.Contains("ReservationToReturnQuantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturnQuantity = (int?) content.GetValueForProperty("ReservationToReturnQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal)this).ReservationToReturnQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.TypeConverter.cs index 8d09f3a87d97..c193e3d0abb6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.cs similarity index 77% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.cs index c020d05fe14f..96ebc815696a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -12,27 +12,27 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// returned and the return reason. /// public partial class RefundRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal { /// Internal Acessors for ReservationToReturn - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestPropertiesInternal.ReservationToReturn { get => (this._reservationToReturn = this._reservationToReturn ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturn()); set { {_reservationToReturn = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestPropertiesInternal.ReservationToReturn { get => (this._reservationToReturn = this._reservationToReturn ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturn()); set { {_reservationToReturn = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn _reservationToReturn; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn _reservationToReturn; /// Reservation to return [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn ReservationToReturn { get => (this._reservationToReturn = this._reservationToReturn ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturn()); set => this._reservationToReturn = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn ReservationToReturn { get => (this._reservationToReturn = this._reservationToReturn ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturn()); set => this._reservationToReturn = value; } /// Quantity to be returned. Must be greater than zero. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? ReservationToReturnQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)ReservationToReturn).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)ReservationToReturn).Quantity = value ?? default(int); } + public int? ReservationToReturnQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)ReservationToReturn).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)ReservationToReturn).Quantity = value ?? default(int); } /// Fully qualified identifier of the reservation being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationToReturnReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)ReservationToReturn).ReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)ReservationToReturn).ReservationId = value ?? null; } + public string ReservationToReturnReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)ReservationToReturn).ReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)ReservationToReturn).ReservationId = value ?? null; } /// Backing field for property. private string _returnReason; @@ -70,6 +70,9 @@ public partial interface IRefundRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity to be returned. Must be greater than zero.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -78,6 +81,9 @@ public partial interface IRefundRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified identifier of the reservation being returned", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] @@ -86,6 +92,9 @@ public partial interface IRefundRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason of returning the reservation", SerializedName = @"returnReason", PossibleTypes = new [] { typeof(string) })] @@ -94,6 +103,9 @@ public partial interface IRefundRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The scope of the refund, e.g. Reservation", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -102,6 +114,9 @@ public partial interface IRefundRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"SessionId that was returned by CalculateRefund API.", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] @@ -114,7 +129,7 @@ internal partial interface IRefundRequestPropertiesInternal { /// Reservation to return - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn ReservationToReturn { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn ReservationToReturn { get; set; } /// Quantity to be returned. Must be greater than zero. int? ReservationToReturnQuantity { get; set; } /// Fully qualified identifier of the reservation being returned diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.json.cs similarity index 93% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.json.cs index 36d0afea4a6a..f5af568294ee 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundRequestProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundRequestProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class RefundRequestProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RefundRequestProperties(json) : null; } @@ -80,10 +80,10 @@ internal RefundRequestProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservations { return; } - {_reservationToReturn = If( json?.PropertyT("reservationToReturn"), out var __jsonReservationToReturn) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationToReturn.FromJson(__jsonReservationToReturn) : ReservationToReturn;} - {_sessionId = If( json?.PropertyT("sessionId"), out var __jsonSessionId) ? (string)__jsonSessionId : (string)SessionId;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_returnReason = If( json?.PropertyT("returnReason"), out var __jsonReturnReason) ? (string)__jsonReturnReason : (string)ReturnReason;} + {_reservationToReturn = If( json?.PropertyT("reservationToReturn"), out var __jsonReservationToReturn) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationToReturn.FromJson(__jsonReservationToReturn) : _reservationToReturn;} + {_sessionId = If( json?.PropertyT("sessionId"), out var __jsonSessionId) ? (string)__jsonSessionId : (string)_sessionId;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_returnReason = If( json?.PropertyT("returnReason"), out var __jsonReturnReason) ? (string)__jsonReturnReason : (string)_returnReason;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.PowerShell.cs new file mode 100644 index 000000000000..dc7c8000e479 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// The response of refund request containing refund information of reservation + [System.ComponentModel.TypeConverter(typeof(RefundResponseTypeConverter))] + public partial class RefundResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RefundResponse(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.Reservations.Models.IRefundResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RefundResponse(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.Reservations.Models.IRefundResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RefundResponse(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.Reservations.Models.IRefundResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponsePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PricingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyResultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingPlan = (string) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingPlan, global::System.Convert.ToString); + } + if (content.Contains("BillingInformationCompletedTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationTotalTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ConsumedRefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("MaxRefundLimit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyErrorTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RefundResponse(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.Reservations.Models.IRefundResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponsePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PricingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyResultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingPlan = (string) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingPlan, global::System.Convert.ToString); + } + if (content.Contains("BillingInformationCompletedTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationTotalTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ConsumedRefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("MaxRefundLimit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyErrorTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The response of refund request containing refund information of reservation + [System.ComponentModel.TypeConverter(typeof(RefundResponseTypeConverter))] + public partial interface IRefundResponse + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.TypeConverter.cs index e8e1f5d5ecac..b85860965eab 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.cs similarity index 56% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.cs index c572f6b3a1a6..85e89e65d5e2 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.cs @@ -3,48 +3,48 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The response of refund request containing refund information of reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] public partial class RefundResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal { /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyProratedAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyProratedAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyProratedAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyProratedAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyProratedAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyProratedAmount = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyRemainingCommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyRemainingCommitmentAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyRemainingCommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyRemainingCommitmentAmount = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyTotalPaidAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyTotalPaidAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyTotalPaidAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingCurrencyTotalPaidAmount = value ?? null /* model class */; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingInformationBillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationBillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); } + public string BillingInformationBillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationBillingPlan = value ?? null; } /// The number of completed transactions in this reservation's payment [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? BillingInformationCompletedTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationCompletedTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationCompletedTransaction = value ?? default(int); } + public int? BillingInformationCompletedTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationCompletedTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationCompletedTransaction = value ?? default(int); } /// The number of total transactions in this reservation's payment [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? BillingInformationTotalTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationTotalTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformationTotalTransaction = value ?? default(int); } + public int? BillingInformationTotalTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationTotalTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformationTotalTransaction = value ?? default(int); } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingRefundAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingRefundAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingRefundAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingRefundAmount = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).ConsumedRefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).ConsumedRefundsTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).ConsumedRefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).ConsumedRefundsTotal = value ?? null /* model class */; } /// Backing field for property. private string _id; @@ -55,38 +55,38 @@ public partial class RefundResponse : /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).MaxRefundLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).MaxRefundLimit = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).MaxRefundLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).MaxRefundLimit = value ?? null /* model class */; } /// Internal Acessors for BillingInformation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal.BillingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).BillingInformation = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal.BillingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).BillingInformation = value; } /// Internal Acessors for PolicyResult - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal.PolicyResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyResult = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal.PolicyResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyResult = value; } /// Internal Acessors for PolicyResultProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal.PolicyResultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyResultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyResultProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal.PolicyResultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyResultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyResultProperty = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponseProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponseProperties()); set { {_property = value;} } } /// Refund Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PolicyError = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PolicyError = value ?? null /* arrayOf */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingRefundAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PricingRefundAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).PricingRefundAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingRefundAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PricingRefundAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).PricingRefundAmount = value ?? null /* model class */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties _property; /// The refund properties of reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponseProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponseProperties()); set => this._property = value; } /// Quantity to be returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).Quantity = value ?? default(int); } + public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).Quantity = value ?? default(int); } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] @@ -94,7 +94,7 @@ public partial class RefundResponse : /// Refund session identifier [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal)Property).SessionId = value ?? null; } + public string SessionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).SessionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)Property).SessionId = value ?? null; } /// Creates an new instance. public RefundResponse() @@ -110,38 +110,54 @@ public partial interface IRefundResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyProratedAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyRemainingCommitmentAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyTotalPaidAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingInformationBillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingInformationBillingPlan { get; set; } /// The number of completed transactions in this reservation's payment [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of completed transactions in this reservation's payment", SerializedName = @"completedTransactions", PossibleTypes = new [] { typeof(int) })] @@ -150,6 +166,9 @@ public partial interface IRefundResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of total transactions in this reservation's payment", SerializedName = @"totalTransactions", PossibleTypes = new [] { typeof(int) })] @@ -158,22 +177,31 @@ public partial interface IRefundResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingRefundAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"consumedRefundsTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get; set; } /// Fully qualified identifier of the reservation being returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified identifier of the reservation being returned", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -182,30 +210,42 @@ public partial interface IRefundResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"maxRefundLimit", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get; set; } /// Refund Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Refund Policy errors", SerializedName = @"policyErrors", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError) })] + System.Collections.Generic.List PolicyError { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"pricingRefundAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingRefundAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingRefundAmount { get; set; } /// Quantity to be returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity to be returned", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -214,6 +254,9 @@ public partial interface IRefundResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Refund session identifier", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] @@ -225,37 +268,38 @@ internal partial interface IRefundResponseInternal { /// billing information - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation BillingInformation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation BillingInformation { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } /// Represent the billing plans. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingInformationBillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingInformationBillingPlan { get; set; } /// The number of completed transactions in this reservation's payment int? BillingInformationCompletedTransaction { get; set; } /// The number of total transactions in this reservation's payment int? BillingInformationTotalTransaction { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get; set; } /// Fully qualified identifier of the reservation being returned string Id { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get; set; } /// Refund Policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get; set; } + System.Collections.Generic.List PolicyError { get; set; } /// Refund policy result - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult PolicyResult { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult PolicyResult { get; set; } /// Refund policy result property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty PolicyResultProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty PolicyResultProperty { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingRefundAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingRefundAmount { get; set; } /// The refund properties of reservation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties Property { get; set; } /// Quantity to be returned int? Quantity { get; set; } /// Refund session identifier diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.json.cs index 7c1a9875c84d..de3020b76b2e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RefundResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RefundResponse(json) : null; } @@ -77,8 +77,8 @@ internal RefundResponse(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime. { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundResponseProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundResponseProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.PowerShell.cs new file mode 100644 index 000000000000..28e969b37073 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.PowerShell.cs @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// The refund properties of reservation + [System.ComponentModel.TypeConverter(typeof(RefundResponsePropertiesTypeConverter))] + public partial class RefundResponseProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RefundResponseProperties(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.Reservations.Models.IRefundResponseProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RefundResponseProperties(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.Reservations.Models.IRefundResponseProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RefundResponseProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PricingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyResultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingPlan = (string) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingPlan, global::System.Convert.ToString); + } + if (content.Contains("BillingInformationCompletedTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationTotalTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ConsumedRefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("MaxRefundLimit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyErrorTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RefundResponseProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PolicyResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyResult = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult) content.GetValueForProperty("PolicyResult",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyResult, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("SessionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).SessionId = (string) content.GetValueForProperty("SessionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).SessionId, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PricingRefundAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PricingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PricingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PricingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyResultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyResultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty) content.GetValueForProperty("PolicyResultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyResultProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResultPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingPlan = (string) content.GetValueForProperty("BillingInformationBillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingPlan, global::System.Convert.ToString); + } + if (content.Contains("BillingInformationCompletedTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationCompletedTransaction = (int?) content.GetValueForProperty("BillingInformationCompletedTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationCompletedTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationTotalTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationTotalTransaction = (int?) content.GetValueForProperty("BillingInformationTotalTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationTotalTransaction, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BillingInformationBillingCurrencyTotalPaidAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyTotalPaidAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyTotalPaidAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyTotalPaidAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyProratedAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyProratedAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyProratedAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyProratedAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("BillingInformationBillingCurrencyRemainingCommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingInformationBillingCurrencyRemainingCommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).BillingInformationBillingCurrencyRemainingCommitmentAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("ConsumedRefundsTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).ConsumedRefundsTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("ConsumedRefundsTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).ConsumedRefundsTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("MaxRefundLimit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).MaxRefundLimit = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("MaxRefundLimit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).MaxRefundLimit, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PolicyError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyError = (System.Collections.Generic.List) content.GetValueForProperty("PolicyError",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal)this).PolicyError, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyErrorTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The refund properties of reservation + [System.ComponentModel.TypeConverter(typeof(RefundResponsePropertiesTypeConverter))] + public partial interface IRefundResponseProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.TypeConverter.cs index 76815f31b6bc..c0d7c662ad3d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.cs similarity index 57% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.cs index 4f518b3f782d..70485247d1d4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.cs @@ -3,88 +3,88 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The refund properties of reservation public partial class RefundResponseProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation _billingInformation; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation _billingInformation; /// billing information [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation BillingInformation { get => (this._billingInformation = this._billingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformation()); set => this._billingInformation = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation BillingInformation { get => (this._billingInformation = this._billingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformation()); set => this._billingInformation = value; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyProratedAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyProratedAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyProratedAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyProratedAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyProratedAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyProratedAmount = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyRemainingCommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyRemainingCommitmentAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyRemainingCommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyRemainingCommitmentAmount = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyTotalPaidAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyTotalPaidAmount = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyTotalPaidAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).BillingCurrencyTotalPaidAmount = value ?? null /* model class */; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingInformationBillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).BillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); } + public string BillingInformationBillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).BillingPlan = value ?? null; } /// The number of completed transactions in this reservation's payment [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? BillingInformationCompletedTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).CompletedTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).CompletedTransaction = value ?? default(int); } + public int? BillingInformationCompletedTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).CompletedTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).CompletedTransaction = value ?? default(int); } /// The number of total transactions in this reservation's payment [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? BillingInformationTotalTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).TotalTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformationInternal)BillingInformation).TotalTransaction = value ?? default(int); } + public int? BillingInformationTotalTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).TotalTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformationInternal)BillingInformation).TotalTransaction = value ?? default(int); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingRefundAmount; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingRefundAmount; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get => (this._billingRefundAmount = this._billingRefundAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingRefundAmount = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get => (this._billingRefundAmount = this._billingRefundAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingRefundAmount = value; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)PolicyResult).ConsumedRefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)PolicyResult).ConsumedRefundsTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)PolicyResult).ConsumedRefundsTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)PolicyResult).ConsumedRefundsTotal = value ?? null /* model class */; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)PolicyResult).MaxRefundLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)PolicyResult).MaxRefundLimit = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)PolicyResult).MaxRefundLimit; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)PolicyResult).MaxRefundLimit = value ?? null /* model class */; } /// Internal Acessors for BillingInformation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal.BillingInformation { get => (this._billingInformation = this._billingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformation()); set { {_billingInformation = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal.BillingInformation { get => (this._billingInformation = this._billingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformation()); set { {_billingInformation = value;} } } /// Internal Acessors for PolicyResult - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal.PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResult()); set { {_policyResult = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal.PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResult()); set { {_policyResult = value;} } } /// Internal Acessors for PolicyResultProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponsePropertiesInternal.PolicyResultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)PolicyResult).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)PolicyResult).Property = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponsePropertiesInternal.PolicyResultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)PolicyResult).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)PolicyResult).Property = value; } /// Refund Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)PolicyResult).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultInternal)PolicyResult).PolicyError = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PolicyError { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)PolicyResult).PolicyError; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultInternal)PolicyResult).PolicyError = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult _policyResult; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult _policyResult; /// Refund policy result [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResult()); set => this._policyResult = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult PolicyResult { get => (this._policyResult = this._policyResult ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResult()); set => this._policyResult = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _pricingRefundAmount; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _pricingRefundAmount; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingRefundAmount { get => (this._pricingRefundAmount = this._pricingRefundAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._pricingRefundAmount = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingRefundAmount { get => (this._pricingRefundAmount = this._pricingRefundAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._pricingRefundAmount = value; } /// Backing field for property. private int? _quantity; @@ -114,38 +114,54 @@ public partial interface IRefundResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyProratedAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyRemainingCommitmentAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyTotalPaidAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingInformationBillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingInformationBillingPlan { get; set; } /// The number of completed transactions in this reservation's payment [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of completed transactions in this reservation's payment", SerializedName = @"completedTransactions", PossibleTypes = new [] { typeof(int) })] @@ -154,6 +170,9 @@ public partial interface IRefundResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of total transactions in this reservation's payment", SerializedName = @"totalTransactions", PossibleTypes = new [] { typeof(int) })] @@ -162,46 +181,64 @@ public partial interface IRefundResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingRefundAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"consumedRefundsTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"maxRefundLimit", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get; set; } /// Refund Policy errors [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Refund Policy errors", SerializedName = @"policyErrors", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyError) })] + System.Collections.Generic.List PolicyError { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"pricingRefundAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingRefundAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingRefundAmount { get; set; } /// Quantity to be returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity to be returned", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -210,6 +247,9 @@ public partial interface IRefundResponseProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Refund session identifier", SerializedName = @"sessionId", PossibleTypes = new [] { typeof(string) })] @@ -221,33 +261,34 @@ internal partial interface IRefundResponsePropertiesInternal { /// billing information - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundBillingInformation BillingInformation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundBillingInformation BillingInformation { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyProratedAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyRemainingCommitmentAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingInformationBillingCurrencyTotalPaidAmount { get; set; } /// Represent the billing plans. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingInformationBillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingInformationBillingPlan { get; set; } /// The number of completed transactions in this reservation's payment int? BillingInformationCompletedTransaction { get; set; } /// The number of total transactions in this reservation's payment int? BillingInformationTotalTransaction { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice ConsumedRefundsTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice ConsumedRefundsTotal { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice MaxRefundLimit { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice MaxRefundLimit { get; set; } /// Refund Policy errors - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyError[] PolicyError { get; set; } + System.Collections.Generic.List PolicyError { get; set; } /// Refund policy result - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResult PolicyResult { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResult PolicyResult { get; set; } /// Refund policy result property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundPolicyResultProperty PolicyResultProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundPolicyResultProperty PolicyResultProperty { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingRefundAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingRefundAmount { get; set; } /// Quantity to be returned int? Quantity { get; set; } /// Refund session identifier diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.json.cs index bc324a48c159..790e1d685553 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RefundResponseProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RefundResponseProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RefundResponseProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundResponseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundResponseProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RefundResponseProperties(json) : null; } @@ -77,12 +77,12 @@ internal RefundResponseProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservation { return; } - {_policyResult = If( json?.PropertyT("policyResult"), out var __jsonPolicyResult) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundPolicyResult.FromJson(__jsonPolicyResult) : PolicyResult;} - {_billingInformation = If( json?.PropertyT("billingInformation"), out var __jsonBillingInformation) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundBillingInformation.FromJson(__jsonBillingInformation) : BillingInformation;} - {_sessionId = If( json?.PropertyT("sessionId"), out var __jsonSessionId) ? (string)__jsonSessionId : (string)SessionId;} - {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : Quantity;} - {_billingRefundAmount = If( json?.PropertyT("billingRefundAmount"), out var __jsonBillingRefundAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingRefundAmount) : BillingRefundAmount;} - {_pricingRefundAmount = If( json?.PropertyT("pricingRefundAmount"), out var __jsonPricingRefundAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonPricingRefundAmount) : PricingRefundAmount;} + {_policyResult = If( json?.PropertyT("policyResult"), out var __jsonPolicyResult) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundPolicyResult.FromJson(__jsonPolicyResult) : _policyResult;} + {_billingInformation = If( json?.PropertyT("billingInformation"), out var __jsonBillingInformation) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundBillingInformation.FromJson(__jsonBillingInformation) : _billingInformation;} + {_sessionId = If( json?.PropertyT("sessionId"), out var __jsonSessionId) ? (string)__jsonSessionId : (string)_sessionId;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : _quantity;} + {_billingRefundAmount = If( json?.PropertyT("billingRefundAmount"), out var __jsonBillingRefundAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingRefundAmount) : _billingRefundAmount;} + {_pricingRefundAmount = If( json?.PropertyT("pricingRefundAmount"), out var __jsonPricingRefundAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonPricingRefundAmount) : _pricingRefundAmount;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.PowerShell.cs new file mode 100644 index 000000000000..157f73b9bacd --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.PowerShell.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.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// The renew properties for a reservation. + [System.ComponentModel.TypeConverter(typeof(RenewPropertiesResponseTypeConverter))] + public partial class RenewPropertiesResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RenewPropertiesResponse(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.Reservations.Models.IRenewPropertiesResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RenewPropertiesResponse(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.Reservations.Models.IRenewPropertiesResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RenewPropertiesResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PurchaseProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchaseProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) content.GetValueForProperty("PurchaseProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchaseProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom); + } + if (content.Contains("PricingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponsePricingCurrencyTotalTypeConverter.ConvertFrom); + } + if (content.Contains("BillingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseBillingCurrencyTotalTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasePropertySku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertySku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("PurchasePropertySku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertySku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasePropertyProperties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertyProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties) content.GetValueForProperty("PurchasePropertyProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertyProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasePropertyLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertyLocation = (string) content.GetValueForProperty("PurchasePropertyLocation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertyLocation, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScope = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PricingCurrencyTotalCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalCurrencyCode = (string) content.GetValueForProperty("PricingCurrencyTotalCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("PricingCurrencyTotalAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalAmount = (float?) content.GetValueForProperty("PricingCurrencyTotalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalAmount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BillingCurrencyTotalCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalCurrencyCode = (string) content.GetValueForProperty("BillingCurrencyTotalCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrencyTotalAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalAmount = (float?) content.GetValueForProperty("BillingCurrencyTotalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalAmount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourcePropertyInstanceFlexibility = (string) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourcePropertyInstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyResourceGroupId, 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 RenewPropertiesResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PurchaseProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchaseProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) content.GetValueForProperty("PurchaseProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchaseProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom); + } + if (content.Contains("PricingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponsePricingCurrencyTotalTypeConverter.ConvertFrom); + } + if (content.Contains("BillingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseBillingCurrencyTotalTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasePropertySku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertySku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("PurchasePropertySku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertySku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasePropertyProperties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertyProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties) content.GetValueForProperty("PurchasePropertyProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertyProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PurchasePropertyLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertyLocation = (string) content.GetValueForProperty("PurchasePropertyLocation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PurchasePropertyLocation, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScope = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PricingCurrencyTotalCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalCurrencyCode = (string) content.GetValueForProperty("PricingCurrencyTotalCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("PricingCurrencyTotalAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalAmount = (float?) content.GetValueForProperty("PricingCurrencyTotalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).PricingCurrencyTotalAmount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BillingCurrencyTotalCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalCurrencyCode = (string) content.GetValueForProperty("BillingCurrencyTotalCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrencyTotalAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalAmount = (float?) content.GetValueForProperty("BillingCurrencyTotalAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingCurrencyTotalAmount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourcePropertyInstanceFlexibility = (string) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).ReservedResourcePropertyInstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal)this).AppliedScopePropertyResourceGroupId, 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The renew properties for a reservation. + [System.ComponentModel.TypeConverter(typeof(RenewPropertiesResponseTypeConverter))] + public partial interface IRenewPropertiesResponse + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.TypeConverter.cs index 7048718d3ca9..fdb74d1a9218 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.cs similarity index 59% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.cs index b9f573ccd981..ab177b11286e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The renew properties for a reservation. public partial class RenewPropertiesResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal { /// @@ -18,146 +18,146 @@ public partial class RenewPropertiesResponse : /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string[] AppliedScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopes; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopes = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AppliedScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopes; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopes = value ?? null /* arrayOf */; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyDisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyDisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertySubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertySubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyTenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopePropertyTenantId = value ?? null; } /// Type of the Applied Scope. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopeType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); } + public string AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopeType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal _billingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal _billingCurrencyTotal; /// /// Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseBillingCurrencyTotal()); set => this._billingCurrencyTotal = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseBillingCurrencyTotal()); set => this._billingCurrencyTotal = value; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? BillingCurrencyTotalAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)BillingCurrencyTotal).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)BillingCurrencyTotal).Amount = value ?? default(float); } + public float? BillingCurrencyTotalAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)BillingCurrencyTotal).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)BillingCurrencyTotal).Amount = value ?? default(float); } /// /// The ISO 4217 3-letter currency code for the currency used by this purchase record. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string BillingCurrencyTotalCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)BillingCurrencyTotal).CurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)BillingCurrencyTotal).CurrencyCode = value ?? null; } + public string BillingCurrencyTotalCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)BillingCurrencyTotal).CurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)BillingCurrencyTotal).CurrencyCode = value ?? null; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).BillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); } + public string BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).BillingPlan = value ?? null; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).BillingScopeId = value ?? null; } + public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).BillingScopeId = value ?? null; } /// Friendly name of the reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).DisplayName = value ?? null; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).AppliedScopeProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).AppliedScopeProperty = value; } /// Internal Acessors for BillingCurrencyTotal - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal.BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseBillingCurrencyTotal()); set { {_billingCurrencyTotal = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal.BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseBillingCurrencyTotal()); set { {_billingCurrencyTotal = value;} } } /// Internal Acessors for PricingCurrencyTotal - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal.PricingCurrencyTotal { get => (this._pricingCurrencyTotal = this._pricingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponsePricingCurrencyTotal()); set { {_pricingCurrencyTotal = value;} } } - - /// Internal Acessors for PurchasePropertiesProperties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal.PurchasePropertiesProperties { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Properties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Properties = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal.PricingCurrencyTotal { get => (this._pricingCurrencyTotal = this._pricingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponsePricingCurrencyTotal()); set { {_pricingCurrencyTotal = value;} } } /// Internal Acessors for PurchaseProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal.PurchaseProperty { get => (this._purchaseProperty = this._purchaseProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest()); set { {_purchaseProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal.PurchaseProperty { get => (this._purchaseProperty = this._purchaseProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest()); set { {_purchaseProperty = value;} } } + + /// Internal Acessors for PurchasePropertyProperties + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal.PurchasePropertyProperties { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Properties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Properties = value; } /// Internal Acessors for PurchasePropertySku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal.PurchasePropertySku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).InternalSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).InternalSkuName = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal.PurchasePropertySku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).InternalSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).InternalSkuName = value; } /// Internal Acessors for ReservedResourceProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseInternal.ReservedResourceProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).ReservedResourceProperties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).ReservedResourceProperties = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseInternal.ReservedResourceProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).ReservedResourceProperties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).ReservedResourceProperties = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal _pricingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal _pricingCurrencyTotal; /// /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked /// price 30 days before expiry. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal PricingCurrencyTotal { get => (this._pricingCurrencyTotal = this._pricingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponsePricingCurrencyTotal()); set => this._pricingCurrencyTotal = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal PricingCurrencyTotal { get => (this._pricingCurrencyTotal = this._pricingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponsePricingCurrencyTotal()); set => this._pricingCurrencyTotal = value; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? PricingCurrencyTotalAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)PricingCurrencyTotal).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)PricingCurrencyTotal).Amount = value ?? default(float); } + public float? PricingCurrencyTotalAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)PricingCurrencyTotal).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)PricingCurrencyTotal).Amount = value ?? default(float); } /// /// The ISO 4217 3-letter currency code for the currency used by this purchase record. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string PricingCurrencyTotalCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)PricingCurrencyTotal).CurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)PricingCurrencyTotal).CurrencyCode = value ?? null; } + public string PricingCurrencyTotalCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)PricingCurrencyTotal).CurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)PricingCurrencyTotal).CurrencyCode = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest _purchaseProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest _purchaseProperty; /// The request for reservation purchase [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest PurchaseProperty { get => (this._purchaseProperty = this._purchaseProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest()); set => this._purchaseProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest PurchaseProperty { get => (this._purchaseProperty = this._purchaseProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest()); set => this._purchaseProperty = value; } /// The Azure region where the reserved resource lives. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string PurchasePropertyLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Location = value ?? null; } + public string PurchasePropertyLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Location = value ?? null; } /// Quantity of the skus that are part of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Quantity = value ?? default(int); } + public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Quantity = value ?? default(int); } /// /// Setting this to true will automatically purchase a new reservation on the expiration date time. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public bool? Renew { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Renew; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Renew = value ?? default(bool); } + public bool? Renew { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Renew; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Renew = value ?? default(bool); } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? ReservedResourcePropertyInstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).InstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).InstanceFlexibility = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); } + public string ReservedResourcePropertyInstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).InstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).InstanceFlexibility = value ?? null; } /// The type of the resource that is being reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).ReservedResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).ReservedResourceType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType)""); } + public string ReservedResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).ReservedResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).ReservedResourceType = value ?? null; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).ReviewDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).ReviewDateTime = value ?? default(global::System.DateTime); } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Sku = value ?? null; } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Sku = value ?? null; } /// Represent the term of reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)PurchaseProperty).Term = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm)""); } + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)PurchaseProperty).Term = value ?? null; } /// Creates an new instance. public RenewPropertiesResponse() @@ -176,14 +176,20 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - string[] AppliedScope { get; set; } + System.Collections.Generic.List AppliedScope { get; set; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -194,6 +200,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -202,6 +211,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -210,6 +222,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -218,6 +233,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -226,14 +244,21 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"amount", PossibleTypes = new [] { typeof(float) })] @@ -244,6 +269,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] @@ -252,14 +280,21 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription that will be charged for purchasing reservation or savings plan", SerializedName = @"billingScopeId", PossibleTypes = new [] { typeof(string) })] @@ -268,6 +303,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name of the reservation", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -276,6 +314,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"amount", PossibleTypes = new [] { typeof(float) })] @@ -286,6 +327,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] @@ -294,6 +338,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The Azure region where the reserved resource lives.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -302,6 +349,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity of the skus that are part of the reservation.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -312,6 +362,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Setting this to true will automatically purchase a new reservation on the expiration date time.", SerializedName = @"renew", PossibleTypes = new [] { typeof(bool) })] @@ -323,22 +376,33 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? ReservedResourcePropertyInstanceFlexibility { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string ReservedResourcePropertyInstanceFlexibility { get; set; } /// The type of the resource that is being reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the resource that is being reserved.", SerializedName = @"reservedResourceType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the Azure hybrid benefit needs to be reviewed.", SerializedName = @"reviewDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -347,6 +411,9 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -355,10 +422,14 @@ public partial interface IRenewPropertiesResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } } /// The renew properties for a reservation. @@ -369,12 +440,12 @@ internal partial interface IRenewPropertiesResponseInternal /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// - string[] AppliedScope { get; set; } + System.Collections.Generic.List AppliedScope { get; set; } /// /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -388,11 +459,12 @@ internal partial interface IRenewPropertiesResponseInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// Type of the Applied Scope. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal BillingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal BillingCurrencyTotal { get; set; } float? BillingCurrencyTotalAmount { get; set; } /// @@ -400,7 +472,8 @@ internal partial interface IRenewPropertiesResponseInternal /// string BillingCurrencyTotalCurrencyCode { get; set; } /// Represent the billing plans. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan string BillingScopeId { get; set; } /// Friendly name of the reservation @@ -409,21 +482,21 @@ internal partial interface IRenewPropertiesResponseInternal /// Amount that Microsoft uses for record. Used during refund for calculating refund limit. Tax is not included. This is locked /// price 30 days before expiry. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal PricingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal PricingCurrencyTotal { get; set; } float? PricingCurrencyTotalAmount { get; set; } /// /// The ISO 4217 3-letter currency code for the currency used by this purchase record. /// string PricingCurrencyTotalCurrencyCode { get; set; } - /// Properties of reservation purchase request - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties PurchasePropertiesProperties { get; set; } /// The request for reservation purchase - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest PurchaseProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest PurchaseProperty { get; set; } /// The Azure region where the reserved resource lives. string PurchasePropertyLocation { get; set; } + /// Properties of reservation purchase request + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties PurchasePropertyProperties { get; set; } /// The name of sku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName PurchasePropertySku { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName PurchasePropertySku { get; set; } /// Quantity of the skus that are part of the reservation. int? Quantity { get; set; } /// @@ -433,20 +506,23 @@ internal partial interface IRenewPropertiesResponseInternal /// /// Properties specific to each reserved resource type. Not required if not applicable. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties ReservedResourceProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties ReservedResourceProperty { get; set; } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? ReservedResourcePropertyInstanceFlexibility { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string ReservedResourcePropertyInstanceFlexibility { get; set; } /// The type of the resource that is being reserved. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. global::System.DateTime? ReviewDateTime { get; set; } string SkuName { get; set; } /// Represent the term of reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.json.cs index 6d05dfc02fa0..44d2775c6aff 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RenewPropertiesResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RenewPropertiesResponse(json) : null; } @@ -77,9 +77,9 @@ internal RenewPropertiesResponse(Microsoft.Azure.PowerShell.Cmdlets.Reservations { return; } - {_purchaseProperty = If( json?.PropertyT("purchaseProperties"), out var __jsonPurchaseProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest.FromJson(__jsonPurchaseProperties) : PurchaseProperty;} - {_pricingCurrencyTotal = If( json?.PropertyT("pricingCurrencyTotal"), out var __jsonPricingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponsePricingCurrencyTotal.FromJson(__jsonPricingCurrencyTotal) : PricingCurrencyTotal;} - {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponseBillingCurrencyTotal.FromJson(__jsonBillingCurrencyTotal) : BillingCurrencyTotal;} + {_purchaseProperty = If( json?.PropertyT("purchaseProperties"), out var __jsonPurchaseProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest.FromJson(__jsonPurchaseProperties) : _purchaseProperty;} + {_pricingCurrencyTotal = If( json?.PropertyT("pricingCurrencyTotal"), out var __jsonPricingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponsePricingCurrencyTotal.FromJson(__jsonPricingCurrencyTotal) : _pricingCurrencyTotal;} + {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseBillingCurrencyTotal.FromJson(__jsonBillingCurrencyTotal) : _billingCurrencyTotal;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.PowerShell.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.PowerShell.cs index 8b0c0a4e07e2..a4b6244b8744 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class RenewPropertiesResponseBillingCurrencyTotal partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RenewPropertiesResponseBillingCurrencyTotal(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RenewPropertiesResponseBillingCurrencyTotal(content); } @@ -100,10 +100,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -118,17 +118,17 @@ internal RenewPropertiesResponseBillingCurrencyTotal(global::System.Collections. // actually deserialize if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -143,11 +143,11 @@ internal RenewPropertiesResponseBillingCurrencyTotal(global::System.Management.A // actually deserialize if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.TypeConverter.cs index 54f71c50dacc..91ef7ef213c9 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.cs index d03b3cbaed37..b1c0be65c01e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included. /// public partial class RenewPropertiesResponseBillingCurrencyTotal : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotalInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotalInternal { /// Backing field for property. @@ -45,6 +45,9 @@ public partial interface IRenewPropertiesResponseBillingCurrencyTotal : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"amount", PossibleTypes = new [] { typeof(float) })] @@ -55,6 +58,9 @@ public partial interface IRenewPropertiesResponseBillingCurrencyTotal : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.json.cs index 3487ffd88003..9704ea197ebf 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponseBillingCurrencyTotal.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponseBillingCurrencyTotal.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class RenewPropertiesResponseBillingCurrencyTotal partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponseBillingCurrencyTotal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponseBillingCurrencyTotal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RenewPropertiesResponseBillingCurrencyTotal(json) : null; } @@ -79,8 +79,8 @@ internal RenewPropertiesResponseBillingCurrencyTotal(Microsoft.Azure.PowerShell. { return; } - {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)CurrencyCode;} - {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (float?)__jsonAmount : Amount;} + {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)_currencyCode;} + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (float?)__jsonAmount : _amount;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.PowerShell.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.PowerShell.cs index 18dfd1600152..1c291e79092d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -66,29 +66,29 @@ public partial class RenewPropertiesResponsePricingCurrencyTotal partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RenewPropertiesResponsePricingCurrencyTotal(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RenewPropertiesResponsePricingCurrencyTotal(content); } @@ -101,10 +101,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -119,17 +119,17 @@ internal RenewPropertiesResponsePricingCurrencyTotal(global::System.Collections. // actually deserialize if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,11 +144,11 @@ internal RenewPropertiesResponsePricingCurrencyTotal(global::System.Management.A // actually deserialize if (content.Contains("CurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).CurrencyCode = (string) content.GetValueForProperty("CurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).CurrencyCode, global::System.Convert.ToString); } if (content.Contains("Amount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).Amount = (float?) content.GetValueForProperty("Amount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal)this).Amount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.TypeConverter.cs index dd65263b5365..3fa765f64756 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.cs index 6ae05907577f..0fda82a64e79 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// price 30 days before expiry. /// public partial class RenewPropertiesResponsePricingCurrencyTotal : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotalInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotalInternal { /// Backing field for property. @@ -47,6 +47,9 @@ public partial interface IRenewPropertiesResponsePricingCurrencyTotal : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"amount", PossibleTypes = new [] { typeof(float) })] @@ -57,6 +60,9 @@ public partial interface IRenewPropertiesResponsePricingCurrencyTotal : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.json.cs index 2935602bceee..4cb7252b07f7 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/RenewPropertiesResponsePricingCurrencyTotal.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/RenewPropertiesResponsePricingCurrencyTotal.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class RenewPropertiesResponsePricingCurrencyTotal partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponsePricingCurrencyTotal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponsePricingCurrencyTotal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new RenewPropertiesResponsePricingCurrencyTotal(json) : null; } @@ -80,8 +80,8 @@ internal RenewPropertiesResponsePricingCurrencyTotal(Microsoft.Azure.PowerShell. { return; } - {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)CurrencyCode;} - {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (float?)__jsonAmount : Amount;} + {_currencyCode = If( json?.PropertyT("currencyCode"), out var __jsonCurrencyCode) ? (string)__jsonCurrencyCode : (string)_currencyCode;} + {_amount = If( json?.PropertyT("amount"), out var __jsonAmount) ? (float?)__jsonAmount : _amount;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.PowerShell.cs similarity index 76% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.PowerShell.cs index 8230966aec39..cd20dacc2a71 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ReservationList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationList(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal ReservationList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponseTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal ReservationList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponseTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.TypeConverter.cs index 264e7436979f..6229c0e024fd 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.cs similarity index 71% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.cs index 99cf78761e64..ea8d087d5ba5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// List of `Reservation`s public partial class ReservationList : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationListInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationListInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class ReservationList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] _value; + private System.Collections.Generic.List _value; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public ReservationList() @@ -40,6 +40,9 @@ public partial interface IReservationList : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Url to get the next page of reservations.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -48,10 +51,13 @@ public partial interface IReservationList : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) })] + System.Collections.Generic.List Value { get; set; } } /// List of `Reservation`s @@ -61,7 +67,7 @@ internal partial interface IReservationListInternal /// Url to get the next page of reservations. string NextLink { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.json.cs index 36818a778fa3..162ff266d3f6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationList.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationList.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationList(json) : null; } @@ -77,8 +77,8 @@ internal ReservationList(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponse.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.PowerShell.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.PowerShell.cs index ba0697c8feff..2e9354da54c1 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ReservationMergeProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationMergeProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationMergeProperties(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,17 +111,17 @@ internal ReservationMergeProperties(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("MergeDestination")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergePropertiesInternal)this).MergeDestination = (string) content.GetValueForProperty("MergeDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergePropertiesInternal)this).MergeDestination, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergePropertiesInternal)this).MergeDestination = (string) content.GetValueForProperty("MergeDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergePropertiesInternal)this).MergeDestination, global::System.Convert.ToString); } if (content.Contains("MergeSources")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergePropertiesInternal)this).MergeSources = (string[]) content.GetValueForProperty("MergeSources",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergePropertiesInternal)this).MergeSources, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergePropertiesInternal)this).MergeSources = (System.Collections.Generic.List) content.GetValueForProperty("MergeSources",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergePropertiesInternal)this).MergeSources, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,11 +136,11 @@ internal ReservationMergeProperties(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("MergeDestination")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergePropertiesInternal)this).MergeDestination = (string) content.GetValueForProperty("MergeDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergePropertiesInternal)this).MergeDestination, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergePropertiesInternal)this).MergeDestination = (string) content.GetValueForProperty("MergeDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergePropertiesInternal)this).MergeDestination, global::System.Convert.ToString); } if (content.Contains("MergeSources")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergePropertiesInternal)this).MergeSources = (string[]) content.GetValueForProperty("MergeSources",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergePropertiesInternal)this).MergeSources, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergePropertiesInternal)this).MergeSources = (System.Collections.Generic.List) content.GetValueForProperty("MergeSources",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergePropertiesInternal)this).MergeSources, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.TypeConverter.cs index 19b1e8dbd061..1fcaa11d9dcb 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.cs similarity index 85% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.cs index 39666961a274..e42a6c9ea71a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties of reservation merge public partial class ReservationMergeProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergePropertiesInternal { /// Backing field for property. @@ -23,13 +23,13 @@ public partial class ReservationMergeProperties : public string MergeDestination { get => this._mergeDestination; set => this._mergeDestination = value; } /// Backing field for property. - private string[] _mergeSources; + private System.Collections.Generic.List _mergeSources; /// /// Resource ids of the source reservation's merged to form this reservation. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public string[] MergeSources { get => this._mergeSources; set => this._mergeSources = value; } + public System.Collections.Generic.List MergeSources { get => this._mergeSources; set => this._mergeSources = value; } /// Creates an new instance. public ReservationMergeProperties() @@ -47,6 +47,9 @@ public partial interface IReservationMergeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reservation resource id Created due to the merge. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"mergeDestination", PossibleTypes = new [] { typeof(string) })] @@ -57,10 +60,13 @@ public partial interface IReservationMergeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource ids of the source reservation's merged to form this reservation. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"mergeSources", PossibleTypes = new [] { typeof(string) })] - string[] MergeSources { get; set; } + System.Collections.Generic.List MergeSources { get; set; } } /// Properties of reservation merge @@ -74,7 +80,7 @@ internal partial interface IReservationMergePropertiesInternal /// /// Resource ids of the source reservation's merged to form this reservation. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// - string[] MergeSources { get; set; } + System.Collections.Generic.List MergeSources { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.json.cs similarity index 91% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.json.cs index 9b991c4f3919..0ec708ececb3 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationMergeProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationMergeProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationMergeProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationMergeProperties(json) : null; } @@ -77,8 +77,8 @@ internal ReservationMergeProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservati { return; } - {_mergeDestination = If( json?.PropertyT("mergeDestination"), out var __jsonMergeDestination) ? (string)__jsonMergeDestination : (string)MergeDestination;} - {_mergeSources = If( json?.PropertyT("mergeSources"), out var __jsonMergeSources) ? If( __jsonMergeSources as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : MergeSources;} + {_mergeDestination = If( json?.PropertyT("mergeDestination"), out var __jsonMergeDestination) ? (string)__jsonMergeDestination : (string)_mergeDestination;} + {_mergeSources = If( json?.PropertyT("mergeSources"), out var __jsonMergeSources) ? If( __jsonMergeSources as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _mergeSources;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.PowerShell.cs similarity index 64% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.PowerShell.cs index ffd66c1c3762..f5879a33a159 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class ReservationOrderBillingPlanInformation partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationOrderBillingPlanInformation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationOrderBillingPlanInformation(content); } @@ -98,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -116,25 +116,25 @@ internal ReservationOrderBillingPlanInformation(global::System.Collections.IDict // actually deserialize if (content.Contains("PricingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("StartDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)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("NextPaymentDueDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).NextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("NextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).NextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).NextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("NextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).NextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Transaction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).Transaction = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[]) content.GetValueForProperty("Transaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).Transaction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).Transaction = (System.Collections.Generic.List) content.GetValueForProperty("Transaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).Transaction, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetailTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -149,19 +149,19 @@ internal ReservationOrderBillingPlanInformation(global::System.Management.Automa // actually deserialize if (content.Contains("PricingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).PricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).PricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("StartDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).StartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).StartDate = (global::System.DateTime?) content.GetValueForProperty("StartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)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("NextPaymentDueDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).NextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("NextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).NextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).NextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("NextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).NextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Transaction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).Transaction = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[]) content.GetValueForProperty("Transaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)this).Transaction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetailTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).Transaction = (System.Collections.Generic.List) content.GetValueForProperty("Transaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)this).Transaction, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetailTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.TypeConverter.cs index 31f967d661f8..6014000e20ed 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.cs similarity index 75% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.cs index a6a0f89d1f3e..e47684ab41a8 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Information describing the type of billing plan for this reservation. public partial class ReservationOrderBillingPlanInformation : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal { /// Backing field for property. @@ -23,11 +23,11 @@ public partial class ReservationOrderBillingPlanInformation : public global::System.DateTime? NextPaymentDueDate { get => this._nextPaymentDueDate; set => this._nextPaymentDueDate = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _pricingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _pricingCurrencyTotal; /// Amount of money to be paid for the Order. Tax is not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingCurrencyTotal { get => (this._pricingCurrencyTotal = this._pricingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._pricingCurrencyTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingCurrencyTotal { get => (this._pricingCurrencyTotal = this._pricingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._pricingCurrencyTotal = value; } /// Backing field for property. private global::System.DateTime? _startDate; @@ -37,10 +37,10 @@ public partial class ReservationOrderBillingPlanInformation : public global::System.DateTime? StartDate { get => this._startDate; set => this._startDate = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] _transaction; + private System.Collections.Generic.List _transaction; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] Transaction { get => this._transaction; set => this._transaction = value; } + public System.Collections.Generic.List Transaction { get => this._transaction; set => this._transaction = value; } /// Creates an new instance. public ReservationOrderBillingPlanInformation() @@ -58,6 +58,9 @@ public partial interface IReservationOrderBillingPlanInformation : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off.", SerializedName = @"nextPaymentDueDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -66,14 +69,20 @@ public partial interface IReservationOrderBillingPlanInformation : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount of money to be paid for the Order. Tax is not included.", SerializedName = @"pricingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingCurrencyTotal { get; set; } /// Date when the billing plan has started. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date when the billing plan has started.", SerializedName = @"startDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -82,10 +91,13 @@ public partial interface IReservationOrderBillingPlanInformation : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"transactions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] Transaction { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail) })] + System.Collections.Generic.List Transaction { get; set; } } /// Information describing the type of billing plan for this reservation. @@ -97,11 +109,11 @@ internal partial interface IReservationOrderBillingPlanInformationInternal /// global::System.DateTime? NextPaymentDueDate { get; set; } /// Amount of money to be paid for the Order. Tax is not included. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PricingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PricingCurrencyTotal { get; set; } /// Date when the billing plan has started. global::System.DateTime? StartDate { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] Transaction { get; set; } + System.Collections.Generic.List Transaction { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.json.cs index 8facc23b145b..6a79204508f2 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderBillingPlanInformation.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderBillingPlanInformation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationOrderBillingPlanInformation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationOrderBillingPlanInformation(json) : null; } @@ -77,10 +77,10 @@ internal ReservationOrderBillingPlanInformation(Microsoft.Azure.PowerShell.Cmdle { return; } - {_pricingCurrencyTotal = If( json?.PropertyT("pricingCurrencyTotal"), out var __jsonPricingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonPricingCurrencyTotal) : PricingCurrencyTotal;} - {_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;} - {_nextPaymentDueDate = If( json?.PropertyT("nextPaymentDueDate"), out var __jsonNextPaymentDueDate) ? global::System.DateTime.TryParse((string)__jsonNextPaymentDueDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonNextPaymentDueDateValue) ? __jsonNextPaymentDueDateValue : NextPaymentDueDate : NextPaymentDueDate;} - {_transaction = If( json?.PropertyT("transactions"), out var __jsonTransactions) ? If( __jsonTransactions as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IPaymentDetail) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PaymentDetail.FromJson(__u) )) ))() : null : Transaction;} + {_pricingCurrencyTotal = If( json?.PropertyT("pricingCurrencyTotal"), out var __jsonPricingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonPricingCurrencyTotal) : _pricingCurrencyTotal;} + {_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;} + {_nextPaymentDueDate = If( json?.PropertyT("nextPaymentDueDate"), out var __jsonNextPaymentDueDate) ? global::System.DateTime.TryParse((string)__jsonNextPaymentDueDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonNextPaymentDueDateValue) ? __jsonNextPaymentDueDateValue : _nextPaymentDueDate : _nextPaymentDueDate;} + {_transaction = If( json?.PropertyT("transactions"), out var __jsonTransactions) ? If( __jsonTransactions as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetail.FromJson(__u) )) ))() : null : _transaction;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.PowerShell.cs similarity index 76% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.PowerShell.cs index 92bdc8f83cc3..466eb2a6f209 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ReservationOrderList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationOrderList(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationOrderList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal ReservationOrderList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponseTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal ReservationOrderList(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponseTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.TypeConverter.cs index a1e8758f6866..5e8cb8484d76 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.cs similarity index 71% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.cs index b6ba92a1c2b0..b4945f550826 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// List of `ReservationOrder`s public partial class ReservationOrderList : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderListInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderListInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class ReservationOrderList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse[] _value; + private System.Collections.Generic.List _value; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public ReservationOrderList() @@ -40,6 +40,9 @@ public partial interface IReservationOrderList : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Url to get the next page of reservationOrders.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -48,10 +51,13 @@ public partial interface IReservationOrderList : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse) })] + System.Collections.Generic.List Value { get; set; } } /// List of `ReservationOrder`s @@ -61,7 +67,7 @@ internal partial interface IReservationOrderListInternal /// Url to get the next page of reservationOrders. string NextLink { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.json.cs index 97e4cae13188..510b3c27cd29 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderList.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderList.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationOrderList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationOrderList(json) : null; } @@ -77,8 +77,8 @@ internal ReservationOrderList(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Ru { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IReservationOrderResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderResponse.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponse.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.PowerShell.cs new file mode 100644 index 000000000000..6a0be65bf718 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.PowerShell.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// Properties of a reservation order. + [System.ComponentModel.TypeConverter(typeof(ReservationOrderPropertiesTypeConverter))] + public partial class ReservationOrderProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationOrderProperties(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.Reservations.Models.IReservationOrderProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationOrderProperties(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.Reservations.Models.IReservationOrderProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationOrderProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PlanInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation) content.GetValueForProperty("PlanInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderBillingPlanInformationTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("RequestDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).RequestDateTime = (global::System.DateTime?) content.GetValueForProperty("RequestDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).RequestDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CreatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BenefitStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OriginalQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).OriginalQuantity = (int?) content.GetValueForProperty("OriginalQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).OriginalQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Reservation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).Reservation = (System.Collections.Generic.List) content.GetValueForProperty("Reservation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).Reservation, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponseTypeConverter.ConvertFrom)); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationPricingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationPricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PlanInformationPricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationPricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PlanInformationStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationStartDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationNextPaymentDueDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationNextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationNextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationNextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationTransaction = (System.Collections.Generic.List) content.GetValueForProperty("PlanInformationTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationTransaction, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetailTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReservationOrderProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PlanInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation) content.GetValueForProperty("PlanInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderBillingPlanInformationTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("RequestDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).RequestDateTime = (global::System.DateTime?) content.GetValueForProperty("RequestDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).RequestDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CreatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BenefitStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OriginalQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).OriginalQuantity = (int?) content.GetValueForProperty("OriginalQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).OriginalQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Reservation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).Reservation = (System.Collections.Generic.List) content.GetValueForProperty("Reservation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).Reservation, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponseTypeConverter.ConvertFrom)); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationPricingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationPricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PlanInformationPricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationPricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PlanInformationStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationStartDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationNextPaymentDueDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationNextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationNextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationNextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationTransaction = (System.Collections.Generic.List) content.GetValueForProperty("PlanInformationTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)this).PlanInformationTransaction, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetailTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Properties of a reservation order. + [System.ComponentModel.TypeConverter(typeof(ReservationOrderPropertiesTypeConverter))] + public partial interface IReservationOrderProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.TypeConverter.cs index f0a382abd4c6..6995e85ef6ae 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.cs similarity index 71% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.cs index 923ebd249ce5..e50eee463428 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties of a reservation order. public partial class ReservationOrderProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ReservationOrderProperties : public global::System.DateTime? BenefitStartTime { get => this._benefitStartTime; set => this._benefitStartTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? _billingPlan; + private string _billingPlan; /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get => this._billingPlan; set => this._billingPlan = value; } + public string BillingPlan { get => this._billingPlan; set => this._billingPlan = value; } /// Backing field for property. private global::System.DateTime? _createdDateTime; @@ -56,7 +56,7 @@ public partial class ReservationOrderProperties : public global::System.DateTime? ExpiryDateTime { get => this._expiryDateTime; set => this._expiryDateTime = value; } /// Internal Acessors for PlanInformation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal.PlanInformation { get => (this._planInformation = this._planInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderBillingPlanInformation()); set { {_planInformation = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal.PlanInformation { get => (this._planInformation = this._planInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderBillingPlanInformation()); set { {_planInformation = value;} } } /// Backing field for property. private int? _originalQuantity; @@ -66,35 +66,35 @@ public partial class ReservationOrderProperties : public int? OriginalQuantity { get => this._originalQuantity; set => this._originalQuantity = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation _planInformation; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation _planInformation; /// Information describing the type of billing plan for this reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation PlanInformation { get => (this._planInformation = this._planInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderBillingPlanInformation()); set => this._planInformation = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation PlanInformation { get => (this._planInformation = this._planInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderBillingPlanInformation()); set => this._planInformation = value; } /// /// For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public global::System.DateTime? PlanInformationNextPaymentDueDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)PlanInformation).NextPaymentDueDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)PlanInformation).NextPaymentDueDate = value ?? default(global::System.DateTime); } + public global::System.DateTime? PlanInformationNextPaymentDueDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)PlanInformation).NextPaymentDueDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)PlanInformation).NextPaymentDueDate = value ?? default(global::System.DateTime); } /// Amount of money to be paid for the Order. Tax is not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PlanInformationPricingCurrencyTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)PlanInformation).PricingCurrencyTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)PlanInformation).PricingCurrencyTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PlanInformationPricingCurrencyTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)PlanInformation).PricingCurrencyTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)PlanInformation).PricingCurrencyTotal = value ?? null /* model class */; } /// Date when the billing plan has started. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public global::System.DateTime? PlanInformationStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)PlanInformation).StartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)PlanInformation).StartDate = value ?? default(global::System.DateTime); } + public global::System.DateTime? PlanInformationStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)PlanInformation).StartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)PlanInformation).StartDate = value ?? default(global::System.DateTime); } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PlanInformationTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)PlanInformation).Transaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformationInternal)PlanInformation).Transaction = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PlanInformationTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)PlanInformation).Transaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformationInternal)PlanInformation).Transaction = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? _provisioningState; + private string _provisioningState; /// Current state of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } + public string ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } /// Backing field for property. private global::System.DateTime? _requestDateTime; @@ -104,10 +104,10 @@ public partial class ReservationOrderProperties : public global::System.DateTime? RequestDateTime { get => this._requestDateTime; set => this._requestDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] _reservation; + private System.Collections.Generic.List _reservation; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Reservation { get => this._reservation; set => this._reservation = value; } + public System.Collections.Generic.List Reservation { get => this._reservation; set => this._reservation = value; } /// Backing field for property. private global::System.DateTime? _reviewDateTime; @@ -117,11 +117,11 @@ public partial class ReservationOrderProperties : public global::System.DateTime? ReviewDateTime { get => this._reviewDateTime; set => this._reviewDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? _term; + private string _term; /// Represent the term of reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get => this._term; set => this._term = value; } + public string Term { get => this._term; set => this._term = value; } /// Creates an new instance. public ReservationOrderProperties() @@ -137,6 +137,9 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the DateTime when the reservation benefit started.", SerializedName = @"benefitStartTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -145,14 +148,21 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// This is the DateTime when the reservation was created. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the DateTime when the reservation was created.", SerializedName = @"createdDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -161,6 +171,9 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name for user to easily identified the reservation.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -169,6 +182,9 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date when the reservation will expire.", SerializedName = @"expiryDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -177,6 +193,9 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the reservation will expire.", SerializedName = @"expiryDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -185,6 +204,9 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Total Quantity of the skus purchased in the reservation.", SerializedName = @"originalQuantity", PossibleTypes = new [] { typeof(int) })] @@ -195,6 +217,9 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off.", SerializedName = @"nextPaymentDueDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -203,14 +228,20 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount of money to be paid for the Order. Tax is not included.", SerializedName = @"pricingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PlanInformationPricingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PlanInformationPricingCurrencyTotal { get; set; } /// Date when the billing plan has started. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date when the billing plan has started.", SerializedName = @"startDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -219,22 +250,32 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"transactions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PlanInformationTransaction { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail) })] + System.Collections.Generic.List PlanInformationTransaction { get; set; } /// Current state of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Current state of the reservation.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", "Merged")] + string ProvisioningState { get; set; } /// This is the DateTime when the reservation was initially requested for purchase. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the DateTime when the reservation was initially requested for purchase.", SerializedName = @"requestDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -243,14 +284,20 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"reservations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Reservation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) })] + System.Collections.Generic.List Reservation { get; set; } /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the Azure Hybrid Benefit needs to be reviewed.", SerializedName = @"reviewDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -259,10 +306,14 @@ public partial interface IReservationOrderProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } } /// Properties of a reservation order. @@ -272,7 +323,8 @@ internal partial interface IReservationOrderPropertiesInternal /// This is the DateTime when the reservation benefit started. global::System.DateTime? BenefitStartTime { get; set; } /// Represent the billing plans. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// This is the DateTime when the reservation was created. global::System.DateTime? CreatedDateTime { get; set; } /// Friendly name for user to easily identified the reservation. @@ -284,27 +336,29 @@ internal partial interface IReservationOrderPropertiesInternal /// Total Quantity of the skus purchased in the reservation. int? OriginalQuantity { get; set; } /// Information describing the type of billing plan for this reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation PlanInformation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation PlanInformation { get; set; } /// /// For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. /// global::System.DateTime? PlanInformationNextPaymentDueDate { get; set; } /// Amount of money to be paid for the Order. Tax is not included. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PlanInformationPricingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PlanInformationPricingCurrencyTotal { get; set; } /// Date when the billing plan has started. global::System.DateTime? PlanInformationStartDate { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PlanInformationTransaction { get; set; } + System.Collections.Generic.List PlanInformationTransaction { get; set; } /// Current state of the reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", "Merged")] + string ProvisioningState { get; set; } /// This is the DateTime when the reservation was initially requested for purchase. global::System.DateTime? RequestDateTime { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Reservation { get; set; } + System.Collections.Generic.List Reservation { get; set; } /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. global::System.DateTime? ReviewDateTime { get; set; } /// Represent the term of reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.json.cs index b43a656a0850..1fee1e0b2795 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationOrderProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationOrderProperties(json) : null; } @@ -77,19 +77,19 @@ internal ReservationOrderProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservati { return; } - {_planInformation = If( json?.PropertyT("planInformation"), out var __jsonPlanInformation) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderBillingPlanInformation.FromJson(__jsonPlanInformation) : PlanInformation;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_requestDateTime = If( json?.PropertyT("requestDateTime"), out var __jsonRequestDateTime) ? global::System.DateTime.TryParse((string)__jsonRequestDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRequestDateTimeValue) ? __jsonRequestDateTimeValue : RequestDateTime : RequestDateTime;} - {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} - {_expiryDate = If( json?.PropertyT("expiryDate"), out var __jsonExpiryDate) ? global::System.DateTime.TryParse((string)__jsonExpiryDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryDateValue) ? __jsonExpiryDateValue : ExpiryDate : ExpiryDate;} - {_expiryDateTime = If( json?.PropertyT("expiryDateTime"), out var __jsonExpiryDateTime) ? global::System.DateTime.TryParse((string)__jsonExpiryDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryDateTimeValue) ? __jsonExpiryDateTimeValue : ExpiryDateTime : ExpiryDateTime;} - {_benefitStartTime = If( json?.PropertyT("benefitStartTime"), out var __jsonBenefitStartTime) ? global::System.DateTime.TryParse((string)__jsonBenefitStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBenefitStartTimeValue) ? __jsonBenefitStartTimeValue : BenefitStartTime : BenefitStartTime;} - {_originalQuantity = If( json?.PropertyT("originalQuantity"), out var __jsonOriginalQuantity) ? (int?)__jsonOriginalQuantity : OriginalQuantity;} - {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)Term;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_billingPlan = If( json?.PropertyT("billingPlan"), out var __jsonBillingPlan) ? (string)__jsonBillingPlan : (string)BillingPlan;} - {_reservation = If( json?.PropertyT("reservations"), out var __jsonReservations) ? If( __jsonReservations as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponse.FromJson(__u) )) ))() : null : Reservation;} - {_reviewDateTime = If( json?.PropertyT("reviewDateTime"), out var __jsonReviewDateTime) ? global::System.DateTime.TryParse((string)__jsonReviewDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReviewDateTimeValue) ? __jsonReviewDateTimeValue : ReviewDateTime : ReviewDateTime;} + {_planInformation = If( json?.PropertyT("planInformation"), out var __jsonPlanInformation) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderBillingPlanInformation.FromJson(__jsonPlanInformation) : _planInformation;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_requestDateTime = If( json?.PropertyT("requestDateTime"), out var __jsonRequestDateTime) ? global::System.DateTime.TryParse((string)__jsonRequestDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRequestDateTimeValue) ? __jsonRequestDateTimeValue : _requestDateTime : _requestDateTime;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : _createdDateTime : _createdDateTime;} + {_expiryDate = If( json?.PropertyT("expiryDate"), out var __jsonExpiryDate) ? global::System.DateTime.TryParse((string)__jsonExpiryDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryDateValue) ? __jsonExpiryDateValue : _expiryDate : _expiryDate;} + {_expiryDateTime = If( json?.PropertyT("expiryDateTime"), out var __jsonExpiryDateTime) ? global::System.DateTime.TryParse((string)__jsonExpiryDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryDateTimeValue) ? __jsonExpiryDateTimeValue : _expiryDateTime : _expiryDateTime;} + {_benefitStartTime = If( json?.PropertyT("benefitStartTime"), out var __jsonBenefitStartTime) ? global::System.DateTime.TryParse((string)__jsonBenefitStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBenefitStartTimeValue) ? __jsonBenefitStartTimeValue : _benefitStartTime : _benefitStartTime;} + {_originalQuantity = If( json?.PropertyT("originalQuantity"), out var __jsonOriginalQuantity) ? (int?)__jsonOriginalQuantity : _originalQuantity;} + {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)_term;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_billingPlan = If( json?.PropertyT("billingPlan"), out var __jsonBillingPlan) ? (string)__jsonBillingPlan : (string)_billingPlan;} + {_reservation = If( json?.PropertyT("reservations"), out var __jsonReservations) ? If( __jsonReservations as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(__u) )) ))() : null : _reservation;} + {_reviewDateTime = If( json?.PropertyT("reviewDateTime"), out var __jsonReviewDateTime) ? global::System.DateTime.TryParse((string)__jsonReviewDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReviewDateTimeValue) ? __jsonReviewDateTimeValue : _reviewDateTime : _reviewDateTime;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.PowerShell.cs new file mode 100644 index 000000000000..c7f9fcfff9c1 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.PowerShell.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.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// Details of a reservation order being returned. + [System.ComponentModel.TypeConverter(typeof(ReservationOrderResponseTypeConverter))] + public partial class ReservationOrderResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationOrderResponse(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.Reservations.Models.IReservationOrderResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationOrderResponse(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.Reservations.Models.IReservationOrderResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationOrderResponse(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.Reservations.Models.IReservationOrderResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Etag = (int?) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Etag, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation) content.GetValueForProperty("PlanInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderBillingPlanInformationTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("RequestDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).RequestDateTime = (global::System.DateTime?) content.GetValueForProperty("RequestDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).RequestDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CreatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BenefitStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OriginalQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).OriginalQuantity = (int?) content.GetValueForProperty("OriginalQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).OriginalQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Reservations")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Reservations = (System.Collections.Generic.List) content.GetValueForProperty("Reservations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Reservations, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponseTypeConverter.ConvertFrom)); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationPricingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationPricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PlanInformationPricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationPricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PlanInformationStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationStartDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationNextPaymentDueDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationNextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationNextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationNextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationTransaction = (System.Collections.Generic.List) content.GetValueForProperty("PlanInformationTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationTransaction, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetailTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReservationOrderResponse(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.Reservations.Models.IReservationOrderResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Etag = (int?) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Etag, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation) content.GetValueForProperty("PlanInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderBillingPlanInformationTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("RequestDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).RequestDateTime = (global::System.DateTime?) content.GetValueForProperty("RequestDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).RequestDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CreatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).CreatedDateTime = (global::System.DateTime?) content.GetValueForProperty("CreatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).CreatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BenefitStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OriginalQuantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).OriginalQuantity = (int?) content.GetValueForProperty("OriginalQuantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).OriginalQuantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Reservations")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Reservations = (System.Collections.Generic.List) content.GetValueForProperty("Reservations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).Reservations, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponseTypeConverter.ConvertFrom)); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationPricingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationPricingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("PlanInformationPricingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationPricingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PlanInformationStartDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationStartDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationStartDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationStartDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationNextPaymentDueDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationNextPaymentDueDate = (global::System.DateTime?) content.GetValueForProperty("PlanInformationNextPaymentDueDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationNextPaymentDueDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PlanInformationTransaction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationTransaction = (System.Collections.Generic.List) content.GetValueForProperty("PlanInformationTransaction",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal)this).PlanInformationTransaction, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PaymentDetailTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Details of a reservation order being returned. + [System.ComponentModel.TypeConverter(typeof(ReservationOrderResponseTypeConverter))] + public partial interface IReservationOrderResponse + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.TypeConverter.cs index 85cb260cb0b9..b04aee06b165 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.cs similarity index 61% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.cs index 86ace8ac36a9..95585a782c71 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.cs @@ -3,35 +3,35 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Details of a reservation order being returned. public partial class ReservationOrderResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal { /// This is the DateTime when the reservation benefit started. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? BenefitStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).BenefitStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).BenefitStartTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? BenefitStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).BenefitStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).BenefitStartTime = value ?? default(global::System.DateTime); } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).BillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); } + public string BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).BillingPlan = value ?? null; } /// This is the DateTime when the reservation was created. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? CreatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).CreatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).CreatedDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? CreatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).CreatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).CreatedDateTime = value ?? default(global::System.DateTime); } /// Friendly name for user to easily identified the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 1)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).DisplayName = value ?? null; } /// Backing field for property. private int? _etag; @@ -43,12 +43,12 @@ public partial class ReservationOrderResponse : /// This is the date when the reservation will expire. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? ExpiryDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).ExpiryDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).ExpiryDate = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpiryDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).ExpiryDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).ExpiryDate = value ?? default(global::System.DateTime); } /// This is the date-time when the reservation will expire. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? ExpiryDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).ExpiryDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).ExpiryDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpiryDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).ExpiryDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).ExpiryDateTime = value ?? default(global::System.DateTime); } /// Backing field for property. private string _id; @@ -59,22 +59,40 @@ public partial class ReservationOrderResponse : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for PlanInformation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal.PlanInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).PlanInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).PlanInformation = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.PlanInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).PlanInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).PlanInformation = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderProperties()); set { {_property = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedByType = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponseInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponseInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -87,50 +105,50 @@ public partial class ReservationOrderResponse : /// Total Quantity of the skus purchased in the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 4, Label = @"Quantity")] - public int? OriginalQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).OriginalQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).OriginalQuantity = value ?? default(int); } + public int? OriginalQuantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).OriginalQuantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).OriginalQuantity = value ?? default(int); } /// /// For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? PlanInformationNextPaymentDueDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).PlanInformationNextPaymentDueDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).PlanInformationNextPaymentDueDate = value ?? default(global::System.DateTime); } + public global::System.DateTime? PlanInformationNextPaymentDueDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).PlanInformationNextPaymentDueDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).PlanInformationNextPaymentDueDate = value ?? default(global::System.DateTime); } /// Amount of money to be paid for the Order. Tax is not included. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PlanInformationPricingCurrencyTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).PlanInformationPricingCurrencyTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).PlanInformationPricingCurrencyTotal = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PlanInformationPricingCurrencyTotal { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).PlanInformationPricingCurrencyTotal; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).PlanInformationPricingCurrencyTotal = value ?? null /* model class */; } /// Date when the billing plan has started. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? PlanInformationStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).PlanInformationStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).PlanInformationStartDate = value ?? default(global::System.DateTime); } + public global::System.DateTime? PlanInformationStartDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).PlanInformationStartDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).PlanInformationStartDate = value ?? default(global::System.DateTime); } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PlanInformationTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).PlanInformationTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).PlanInformationTransaction = value ?? null /* arrayOf */; } + public System.Collections.Generic.List PlanInformationTransaction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).PlanInformationTransaction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).PlanInformationTransaction = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties _property; /// Properties of a reservation order. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderProperties()); set => this._property = value; } /// Current state of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 3, Label = @"State")] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).ProvisioningState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState)""); } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).ProvisioningState = value ?? null; } /// This is the DateTime when the reservation was initially requested for purchase. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? RequestDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).RequestDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).RequestDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? RequestDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).RequestDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).RequestDateTime = value ?? default(global::System.DateTime); } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Reservations { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).Reservation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).Reservation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Reservations { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).Reservation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).Reservation = value ?? null /* arrayOf */; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] @@ -140,50 +158,50 @@ public partial class ReservationOrderResponse : /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).ReviewDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).ReviewDateTime = value ?? default(global::System.DateTime); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData _systemData; /// Metadata pertaining to creation and last modification of the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Represent the term of reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 2)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderPropertiesInternal)Property).Term = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm)""); } + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderPropertiesInternal)Property).Term = value ?? null; } /// Backing field for property. private string _type; @@ -207,6 +225,9 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the DateTime when the reservation benefit started.", SerializedName = @"benefitStartTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -215,14 +236,21 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// This is the DateTime when the reservation was created. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the DateTime when the reservation was created.", SerializedName = @"createdDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -231,6 +259,9 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name for user to easily identified the reservation.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -239,6 +270,9 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"etag", PossibleTypes = new [] { typeof(int) })] @@ -247,6 +281,9 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date when the reservation will expire.", SerializedName = @"expiryDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -255,6 +292,9 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the reservation will expire.", SerializedName = @"expiryDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -263,6 +303,9 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Identifier of the reservation", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -271,6 +314,9 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the reservation", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -279,6 +325,9 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Total Quantity of the skus purchased in the reservation.", SerializedName = @"originalQuantity", PossibleTypes = new [] { typeof(int) })] @@ -289,6 +338,9 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off.", SerializedName = @"nextPaymentDueDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -297,14 +349,20 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Amount of money to be paid for the Order. Tax is not included.", SerializedName = @"pricingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PlanInformationPricingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PlanInformationPricingCurrencyTotal { get; set; } /// Date when the billing plan has started. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date when the billing plan has started.", SerializedName = @"startDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -313,22 +371,32 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"transactions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PlanInformationTransaction { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPaymentDetail) })] + System.Collections.Generic.List PlanInformationTransaction { get; set; } /// Current state of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Current state of the reservation.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", "Merged")] + string ProvisioningState { get; set; } /// This is the DateTime when the reservation was initially requested for purchase. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the DateTime when the reservation was initially requested for purchase.", SerializedName = @"requestDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -337,14 +405,20 @@ public partial interface IReservationOrderResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"reservations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Reservations { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) })] + System.Collections.Generic.List Reservations { get; set; } /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the Azure Hybrid Benefit needs to be reviewed.", SerializedName = @"reviewDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -352,63 +426,90 @@ public partial interface IReservationOrderResponse : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// Represent the term of reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } /// Type of resource. "Microsoft.Capacity/reservations" [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Type of resource. ""Microsoft.Capacity/reservations""", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -422,7 +523,8 @@ internal partial interface IReservationOrderResponseInternal /// This is the DateTime when the reservation benefit started. global::System.DateTime? BenefitStartTime { get; set; } /// Represent the billing plans. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// This is the DateTime when the reservation was created. global::System.DateTime? CreatedDateTime { get; set; } /// Friendly name for user to easily identified the reservation. @@ -440,43 +542,47 @@ internal partial interface IReservationOrderResponseInternal /// Total Quantity of the skus purchased in the reservation. int? OriginalQuantity { get; set; } /// Information describing the type of billing plan for this reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderBillingPlanInformation PlanInformation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderBillingPlanInformation PlanInformation { get; set; } /// /// For recurring billing plans, indicates the date when next payment will be processed. Null when total is paid off. /// global::System.DateTime? PlanInformationNextPaymentDueDate { get; set; } /// Amount of money to be paid for the Order. Tax is not included. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice PlanInformationPricingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice PlanInformationPricingCurrencyTotal { get; set; } /// Date when the billing plan has started. global::System.DateTime? PlanInformationStartDate { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPaymentDetail[] PlanInformationTransaction { get; set; } + System.Collections.Generic.List PlanInformationTransaction { get; set; } /// Properties of a reservation order. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderProperties Property { get; set; } /// Current state of the reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", "Merged")] + string ProvisioningState { get; set; } /// This is the DateTime when the reservation was initially requested for purchase. global::System.DateTime? RequestDateTime { get; set; } - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Reservations { get; set; } + System.Collections.Generic.List Reservations { get; set; } /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. global::System.DateTime? ReviewDateTime { get; set; } /// Metadata pertaining to creation and last modification of the resource. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// Represent the term of reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } /// Type of resource. "Microsoft.Capacity/reservations" string Type { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.json.cs index d226f46b3527..22de11ccb702 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationOrderResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationOrderResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationOrderResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationOrderResponse(json) : null; } @@ -77,12 +77,12 @@ internal ReservationOrderResponse(Microsoft.Azure.PowerShell.Cmdlets.Reservation { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (int?)__jsonEtag : Etag;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (int?)__jsonEtag : _etag;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -106,20 +106,20 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } AddIf( null != this._etag ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((int)this._etag) : null, "etag" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.PowerShell.cs new file mode 100644 index 000000000000..d256b0fcd35a --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.PowerShell.cs @@ -0,0 +1,636 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// The definition of the reservation. + [System.ComponentModel.TypeConverter(typeof(ReservationResponseTypeConverter))] + public partial class ReservationResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationResponse(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.Reservations.Models.IReservationResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationResponse(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.Reservations.Models.IReservationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InternalSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Etag = (int?) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Etag, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).InstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopes")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopes = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SwapProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties) content.GetValueForProperty("SwapProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSwapPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Utilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Utilization = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization) content.GetValueForProperty("Utilization",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Utilization, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesUtilizationTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("Archived")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Archived = (bool?) content.GetValueForProperty("Archived",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Archived, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Capability = (string) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Capability, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EffectiveDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).EffectiveDateTime = (global::System.DateTime?) content.GetValueForProperty("EffectiveDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).EffectiveDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BenefitStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastUpdatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).LastUpdatedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastUpdatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).LastUpdatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SkuDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SkuDescription, global::System.Convert.ToString); + } + if (content.Contains("ExtendedStatusInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfoTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).DisplayProvisioningState = (string) content.GetValueForProperty("DisplayProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).DisplayProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningSubState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ProvisioningSubState = (string) content.GetValueForProperty("ProvisioningSubState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ProvisioningSubState, global::System.Convert.ToString); + } + if (content.Contains("PurchaseDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).PurchaseDate = (global::System.DateTime?) content.GetValueForProperty("PurchaseDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).PurchaseDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PurchaseDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).PurchaseDateTime = (global::System.DateTime?) content.GetValueForProperty("PurchaseDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).PurchaseDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SplitProperties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SplitProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties) content.GetValueForProperty("SplitProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SplitProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSplitPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("MergeProperties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).MergeProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties) content.GetValueForProperty("MergeProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).MergeProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationMergePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("RenewSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewSource = (string) content.GetValueForProperty("RenewSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewSource, global::System.Convert.ToString); + } + if (content.Contains("RenewDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewDestination = (string) content.GetValueForProperty("RenewDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewDestination, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("UserFriendlyAppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UserFriendlyAppliedScopeType = (string) content.GetValueForProperty("UserFriendlyAppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UserFriendlyAppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("UserFriendlyRenewState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UserFriendlyRenewState = (string) content.GetValueForProperty("UserFriendlyRenewState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UserFriendlyRenewState, global::System.Convert.ToString); + } + if (content.Contains("RenewProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseTypeConverter.ConvertFrom); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("SwapPropertySwapSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapPropertySwapSource = (string) content.GetValueForProperty("SwapPropertySwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapPropertySwapSource, global::System.Convert.ToString); + } + if (content.Contains("SwapPropertySwapDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapPropertySwapDestination = (string) content.GetValueForProperty("SwapPropertySwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapPropertySwapDestination, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("UtilizationTrend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UtilizationTrend = (string) content.GetValueForProperty("UtilizationTrend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UtilizationTrend, global::System.Convert.ToString); + } + if (content.Contains("UtilizationAggregate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UtilizationAggregate = (System.Collections.Generic.List) content.GetValueForProperty("UtilizationAggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UtilizationAggregate, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationUtilizationAggregatesTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReservationResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InternalSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Etag = (int?) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Etag, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Kind, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).InstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopes")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopes = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScopes",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopes, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SwapProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties) content.GetValueForProperty("SwapProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSwapPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Utilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Utilization = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization) content.GetValueForProperty("Utilization",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Utilization, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesUtilizationTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("Archived")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Archived = (bool?) content.GetValueForProperty("Archived",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Archived, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Capability = (string) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Capability, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EffectiveDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).EffectiveDateTime = (global::System.DateTime?) content.GetValueForProperty("EffectiveDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).EffectiveDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BenefitStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastUpdatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).LastUpdatedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastUpdatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).LastUpdatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SkuDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SkuDescription, global::System.Convert.ToString); + } + if (content.Contains("ExtendedStatusInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfoTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).DisplayProvisioningState = (string) content.GetValueForProperty("DisplayProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).DisplayProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningSubState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ProvisioningSubState = (string) content.GetValueForProperty("ProvisioningSubState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).ProvisioningSubState, global::System.Convert.ToString); + } + if (content.Contains("PurchaseDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).PurchaseDate = (global::System.DateTime?) content.GetValueForProperty("PurchaseDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).PurchaseDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PurchaseDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).PurchaseDateTime = (global::System.DateTime?) content.GetValueForProperty("PurchaseDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).PurchaseDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SplitProperties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SplitProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties) content.GetValueForProperty("SplitProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SplitProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSplitPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("MergeProperties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).MergeProperties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties) content.GetValueForProperty("MergeProperties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).MergeProperties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationMergePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("RenewSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewSource = (string) content.GetValueForProperty("RenewSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewSource, global::System.Convert.ToString); + } + if (content.Contains("RenewDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewDestination = (string) content.GetValueForProperty("RenewDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewDestination, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("UserFriendlyAppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UserFriendlyAppliedScopeType = (string) content.GetValueForProperty("UserFriendlyAppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UserFriendlyAppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("UserFriendlyRenewState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UserFriendlyRenewState = (string) content.GetValueForProperty("UserFriendlyRenewState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UserFriendlyRenewState, global::System.Convert.ToString); + } + if (content.Contains("RenewProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseTypeConverter.ConvertFrom); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("SwapPropertySwapSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapPropertySwapSource = (string) content.GetValueForProperty("SwapPropertySwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapPropertySwapSource, global::System.Convert.ToString); + } + if (content.Contains("SwapPropertySwapDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapPropertySwapDestination = (string) content.GetValueForProperty("SwapPropertySwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).SwapPropertySwapDestination, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("UtilizationTrend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UtilizationTrend = (string) content.GetValueForProperty("UtilizationTrend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UtilizationTrend, global::System.Convert.ToString); + } + if (content.Contains("UtilizationAggregate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UtilizationAggregate = (System.Collections.Generic.List) content.GetValueForProperty("UtilizationAggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal)this).UtilizationAggregate, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationUtilizationAggregatesTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The definition of the reservation. + [System.ComponentModel.TypeConverter(typeof(ReservationResponseTypeConverter))] + public partial interface IReservationResponse + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.TypeConverter.cs index d9d750ab6f20..e2b34e504624 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.cs similarity index 63% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.cs index 5597712e284f..c6cccca4956f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.cs @@ -3,98 +3,97 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The definition of the reservation. public partial class ReservationResponse : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ProxyResource(); /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopePropertyDisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopePropertyDisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopePropertyManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopePropertyManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopePropertyResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopePropertyResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopePropertySubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopePropertySubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopePropertyTenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopePropertyTenantId = value ?? null; } /// The applied scope type [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopeType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); } + public string AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopeType = value ?? null; } /// The list of applied scopes [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string[] AppliedScopes { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScope = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AppliedScopes { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScope = value ?? null /* arrayOf */; } /// Indicates if the reservation is archived [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public bool? Archived { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Archived; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Archived = value ?? default(bool); } + public bool? Archived { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Archived; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Archived = value ?? default(bool); } /// This is the DateTime when the reservation benefit started. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 4)] - public global::System.DateTime? BenefitStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).BenefitStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).BenefitStartTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? BenefitStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).BenefitStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).BenefitStartTime = value ?? default(global::System.DateTime); } /// The billing plan options available for this sku. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).BillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); } + public string BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).BillingPlan = value ?? null; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).BillingScopeId = value ?? null; } + public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).BillingScopeId = value ?? null; } /// Capabilities of the reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string Capability { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Capability; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Capability = value ?? null; } + public string Capability { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Capability; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Capability = value ?? null; } /// Friendly name for user to easily identify the reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).DisplayName = value ?? null; } /// The provisioning state of the reservation for display, e.g. Succeeded [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string DisplayProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).DisplayProvisioningState; } + public string DisplayProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).DisplayProvisioningState; } /// DateTime of the reservation starting when this version is effective from. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? EffectiveDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).EffectiveDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).EffectiveDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? EffectiveDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).EffectiveDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).EffectiveDateTime = value ?? default(global::System.DateTime); } /// Backing field for property. private int? _etag; @@ -106,24 +105,24 @@ public partial class ReservationResponse : /// This is the date when the reservation will expire. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 5)] - public global::System.DateTime? ExpiryDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ExpiryDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ExpiryDate = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpiryDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ExpiryDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ExpiryDate = value ?? default(global::System.DateTime); } /// This is the date-time when the reservation will expire. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? ExpiryDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ExpiryDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ExpiryDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ExpiryDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ExpiryDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ExpiryDateTime = value ?? default(global::System.DateTime); } /// The message giving detailed information about the status code. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo ExtendedStatusInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ExtendedStatusInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ExtendedStatusInfo = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo ExtendedStatusInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ExtendedStatusInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ExtendedStatusInfo = value ?? null /* model class */; } /// /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).Id; } /// /// Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size @@ -131,28 +130,28 @@ public partial class ReservationResponse : /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).InstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).InstanceFlexibility = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); } + public string InstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).InstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).InstanceFlexibility = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName _internalSkuName; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName _internalSkuName; /// The sku information associated to this reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName()); set => this._internalSkuName = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName()); set => this._internalSkuName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind? _kind; + private string _kind; /// Resource Provider type to be reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind? Kind { get => this._kind; set => this._kind = value; } + public string Kind { get => this._kind; set => this._kind = value; } /// DateTime of the last time the reservation was updated. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 6)] - public global::System.DateTime? LastUpdatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).LastUpdatedDateTime; } + public global::System.DateTime? LastUpdatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).LastUpdatedDateTime; } /// Backing field for property. private string _location; @@ -165,121 +164,142 @@ public partial class ReservationResponse : /// Properties of reservation merge [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties MergeProperties { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).MergeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).MergeProperty = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties MergeProperties { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).MergeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).MergeProperty = value ?? null /* model class */; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).AppliedScopeProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).AppliedScopeProperty = value; } /// Internal Acessors for DisplayProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.DisplayProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).DisplayProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).DisplayProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.DisplayProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).DisplayProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).DisplayProvisioningState = value; } /// Internal Acessors for InternalSkuName - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName()); set { {_internalSkuName = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName()); set { {_internalSkuName = value;} } } /// Internal Acessors for LastUpdatedDateTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.LastUpdatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).LastUpdatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).LastUpdatedDateTime = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.LastUpdatedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).LastUpdatedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).LastUpdatedDateTime = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningSubState - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.ProvisioningSubState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ProvisioningSubState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ProvisioningSubState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.ProvisioningSubState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ProvisioningSubState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ProvisioningSubState = value; } /// Internal Acessors for SwapProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.SwapProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).SwapProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).SwapProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.SwapProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).SwapProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).SwapProperty = value; } /// Internal Acessors for UserFriendlyAppliedScopeType - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.UserFriendlyAppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UserFriendlyAppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UserFriendlyAppliedScopeType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.UserFriendlyAppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UserFriendlyAppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UserFriendlyAppliedScopeType = value; } /// Internal Acessors for UserFriendlyRenewState - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.UserFriendlyRenewState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UserFriendlyRenewState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UserFriendlyRenewState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.UserFriendlyRenewState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UserFriendlyRenewState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UserFriendlyRenewState = value; } /// Internal Acessors for Utilization - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.Utilization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Utilization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Utilization = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.Utilization { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Utilization; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Utilization = value; } + + /// Internal Acessors for UtilizationAggregate + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.UtilizationAggregate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UtilizationAggregate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UtilizationAggregate = value; } /// Internal Acessors for UtilizationTrend - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponseInternal.UtilizationTrend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UtilizationTrend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UtilizationTrend = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponseInternal.UtilizationTrend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UtilizationTrend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UtilizationTrend = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemData = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemData = value; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).Type = value; } /// The name of the resource [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 1, Label = @"ReservationOrderId/ReservationId")] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties _property; /// The properties associated to this reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsProperties()); set => this._property = value; } /// Current state of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 3, Label = @"State")] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ProvisioningState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState)""); } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ProvisioningState = value ?? null; } /// The provisioning sub-state of the reservation, e.g. Succeeded [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string ProvisioningSubState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ProvisioningSubState; } + public string ProvisioningSubState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ProvisioningSubState; } /// This is the date when the reservation was purchased. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? PurchaseDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).PurchaseDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).PurchaseDate = value ?? default(global::System.DateTime); } + public global::System.DateTime? PurchaseDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).PurchaseDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).PurchaseDate = value ?? default(global::System.DateTime); } /// This is the date-time when the reservation was purchased. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? PurchaseDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).PurchaseDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).PurchaseDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? PurchaseDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).PurchaseDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).PurchaseDateTime = value ?? default(global::System.DateTime); } /// Quantity of the skus that are part of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Quantity = value ?? default(int); } + public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Quantity = value ?? default(int); } /// /// Setting this to true will automatically purchase a new reservation on the expiration date time. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public bool? Renew { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Renew; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Renew = value ?? default(bool); } + public bool? Renew { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Renew; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Renew = value ?? default(bool); } /// /// Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string RenewDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).RenewDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).RenewDestination = value ?? null; } + public string RenewDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).RenewDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).RenewDestination = value ?? null; } /// The renew properties for a reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse RenewProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).RenewProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).RenewProperty = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse RenewProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).RenewProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).RenewProperty = value ?? null /* model class */; } /// /// Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string RenewSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).RenewSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).RenewSource = value ?? null; } + public string RenewSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).RenewSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).RenewSource = value ?? null; } /// The type of the resource that is being reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ReservedResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ReservedResourceType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType)""); } + public string ReservedResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ReservedResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ReservedResourceType = value ?? null; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] @@ -289,104 +309,104 @@ public partial class ReservationResponse : /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).ReviewDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).ReviewDateTime = value ?? default(global::System.DateTime); } /// Description of the sku in english. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 7)] - public string SkuDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).SkuDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).SkuDescription = value ?? null; } + public string SkuDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).SkuDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).SkuDescription = value ?? null; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal)InternalSkuName).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal)InternalSkuName).Name = value ?? null; } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal)InternalSkuName).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal)InternalSkuName).Name = value ?? null; } /// Properties of reservation split [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties SplitProperties { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).SplitProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).SplitProperty = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties SplitProperties { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).SplitProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).SplitProperty = value ?? null /* model class */; } /// /// Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string SwapPropertySwapDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).SwapPropertySwapDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).SwapPropertySwapDestination = value ?? null; } + public string SwapPropertySwapDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).SwapPropertySwapDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).SwapPropertySwapDestination = value ?? null; } /// /// Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string SwapPropertySwapSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).SwapPropertySwapSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).SwapPropertySwapSource = value ?? null; } + public string SwapPropertySwapSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).SwapPropertySwapSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).SwapPropertySwapSource = value ?? null; } /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemData; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemData = value ?? null /* model class */; } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataCreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataCreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataCreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).SystemDataLastModifiedByType; } /// Represent the term of reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).Term = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm)""); } + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).Term = value ?? null; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)__proxyResource).Type; } /// The applied scope type of the reservation for display, e.g. Shared [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string UserFriendlyAppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UserFriendlyAppliedScopeType; } + public string UserFriendlyAppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UserFriendlyAppliedScopeType; } /// The renew state of the reservation for display, e.g. On [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string UserFriendlyRenewState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UserFriendlyRenewState; } + public string UserFriendlyRenewState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UserFriendlyRenewState; } /// The array of aggregates of a reservation's utilization [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[] UtilizationAggregate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UtilizationAggregate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UtilizationAggregate = value ?? null /* arrayOf */; } + public System.Collections.Generic.List UtilizationAggregate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UtilizationAggregate; } /// last 7 day utilization trend for a reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotFormat] - public string UtilizationTrend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal)Property).UtilizationTrend; } + public string UtilizationTrend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)Property).UtilizationTrend; } /// Creates an new instance. public ReservationResponse() @@ -402,19 +422,22 @@ public ReservationResponse() /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } } /// The definition of the reservation. public partial interface IReservationResponse : Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResource { /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -425,6 +448,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -433,6 +459,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -441,6 +470,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -449,6 +481,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -457,22 +492,32 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The applied scope type", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// The list of applied scopes [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of applied scopes", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - string[] AppliedScopes { get; set; } + System.Collections.Generic.List AppliedScopes { get; set; } /// Indicates if the reservation is archived [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates if the reservation is archived", SerializedName = @"archived", PossibleTypes = new [] { typeof(bool) })] @@ -481,6 +526,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the DateTime when the reservation benefit started.", SerializedName = @"benefitStartTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -489,14 +537,21 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The billing plan options available for this sku.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription that will be charged for purchasing reservation or savings plan", SerializedName = @"billingScopeId", PossibleTypes = new [] { typeof(string) })] @@ -505,6 +560,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Capabilities of the reservation", SerializedName = @"capabilities", PossibleTypes = new [] { typeof(string) })] @@ -513,6 +571,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name for user to easily identify the reservation", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -521,6 +582,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the reservation for display, e.g. Succeeded", SerializedName = @"displayProvisioningState", PossibleTypes = new [] { typeof(string) })] @@ -529,6 +593,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime of the reservation starting when this version is effective from.", SerializedName = @"effectiveDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -537,6 +604,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"etag", PossibleTypes = new [] { typeof(int) })] @@ -545,6 +615,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date when the reservation will expire.", SerializedName = @"expiryDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -553,6 +626,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the reservation will expire.", SerializedName = @"expiryDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -561,10 +637,13 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The message giving detailed information about the status code.", SerializedName = @"extendedStatusInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo ExtendedStatusInfo { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo ExtendedStatusInfo { get; set; } /// /// Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size /// flexibility. @@ -572,22 +651,33 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } /// Resource Provider type to be reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource Provider type to be reserved.", SerializedName = @"kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind? Kind { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Microsoft.Compute")] + string Kind { get; set; } /// DateTime of the last time the reservation was updated. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DateTime of the last time the reservation was updated.", SerializedName = @"lastUpdatedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -596,6 +686,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The Azure region where the reserved resource lives.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -604,22 +697,32 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Properties of reservation merge", SerializedName = @"mergeProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties MergeProperties { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties MergeProperties { get; set; } /// Current state of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Current state of the reservation.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", "Merged")] + string ProvisioningState { get; set; } /// The provisioning sub-state of the reservation, e.g. Succeeded [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning sub-state of the reservation, e.g. Succeeded", SerializedName = @"provisioningSubState", PossibleTypes = new [] { typeof(string) })] @@ -628,6 +731,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date when the reservation was purchased.", SerializedName = @"purchaseDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -636,6 +742,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the reservation was purchased.", SerializedName = @"purchaseDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -644,6 +753,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity of the skus that are part of the reservation.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -654,6 +766,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Setting this to true will automatically purchase a new reservation on the expiration date time.", SerializedName = @"renew", PossibleTypes = new [] { typeof(bool) })] @@ -664,6 +779,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.", SerializedName = @"renewDestination", PossibleTypes = new [] { typeof(string) })] @@ -672,16 +790,22 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The renew properties for a reservation.", SerializedName = @"renewProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse RenewProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse RenewProperty { get; set; } /// /// Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.", SerializedName = @"renewSource", PossibleTypes = new [] { typeof(string) })] @@ -690,14 +814,21 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the resource that is being reserved.", SerializedName = @"reservedResourceType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the Azure Hybrid Benefit needs to be reviewed.", SerializedName = @"reviewDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -706,6 +837,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description of the sku in english.", SerializedName = @"skuDescription", PossibleTypes = new [] { typeof(string) })] @@ -714,6 +848,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -722,16 +859,22 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Properties of reservation split", SerializedName = @"splitProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties SplitProperties { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties SplitProperties { get; set; } /// /// Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"swapDestination", PossibleTypes = new [] { typeof(string) })] @@ -742,6 +885,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"swapSource", PossibleTypes = new [] { typeof(string) })] @@ -750,14 +896,21 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } /// The applied scope type of the reservation for display, e.g. Shared [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The applied scope type of the reservation for display, e.g. Shared", SerializedName = @"userFriendlyAppliedScopeType", PossibleTypes = new [] { typeof(string) })] @@ -766,6 +919,9 @@ public partial interface IReservationResponse : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The renew state of the reservation for display, e.g. On", SerializedName = @"userFriendlyRenewState", PossibleTypes = new [] { typeof(string) })] @@ -773,15 +929,21 @@ public partial interface IReservationResponse : /// The array of aggregates of a reservation's utilization [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The array of aggregates of a reservation's utilization", SerializedName = @"aggregates", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[] UtilizationAggregate { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates) })] + System.Collections.Generic.List UtilizationAggregate { get; } /// last 7 day utilization trend for a reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"last 7 day utilization trend for a reservation", SerializedName = @"trend", PossibleTypes = new [] { typeof(string) })] @@ -790,13 +952,13 @@ public partial interface IReservationResponse : } /// The definition of the reservation. internal partial interface IReservationResponseInternal : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IProxyResourceInternal { /// /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -810,15 +972,17 @@ internal partial interface IReservationResponseInternal : /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// The applied scope type - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// The list of applied scopes - string[] AppliedScopes { get; set; } + System.Collections.Generic.List AppliedScopes { get; set; } /// Indicates if the reservation is archived bool? Archived { get; set; } /// This is the DateTime when the reservation benefit started. global::System.DateTime? BenefitStartTime { get; set; } /// The billing plan options available for this sku. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan string BillingScopeId { get; set; } /// Capabilities of the reservation @@ -836,26 +1000,29 @@ internal partial interface IReservationResponseInternal : /// This is the date-time when the reservation will expire. global::System.DateTime? ExpiryDateTime { get; set; } /// The message giving detailed information about the status code. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo ExtendedStatusInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo ExtendedStatusInfo { get; set; } /// /// Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size /// flexibility. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } /// The sku information associated to this reservation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName InternalSkuName { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName InternalSkuName { get; set; } /// Resource Provider type to be reserved. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind? Kind { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Microsoft.Compute")] + string Kind { get; set; } /// DateTime of the last time the reservation was updated. global::System.DateTime? LastUpdatedDateTime { get; set; } /// The Azure region where the reserved resource lives. string Location { get; set; } /// Properties of reservation merge - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties MergeProperties { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties MergeProperties { get; set; } /// The properties associated to this reservation - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties Property { get; set; } /// Current state of the reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", "Merged")] + string ProvisioningState { get; set; } /// The provisioning sub-state of the reservation, e.g. Succeeded string ProvisioningSubState { get; set; } /// This is the date when the reservation was purchased. @@ -873,13 +1040,14 @@ internal partial interface IReservationResponseInternal : /// string RenewDestination { get; set; } /// The renew properties for a reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse RenewProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse RenewProperty { get; set; } /// /// Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. /// string RenewSource { get; set; } /// The type of the resource that is being reserved. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. global::System.DateTime? ReviewDateTime { get; set; } /// Description of the sku in english. @@ -887,9 +1055,9 @@ internal partial interface IReservationResponseInternal : string SkuName { get; set; } /// Properties of reservation split - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties SplitProperties { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties SplitProperties { get; set; } /// Properties of reservation swap - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties SwapProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties SwapProperty { get; set; } /// /// Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// @@ -899,15 +1067,16 @@ internal partial interface IReservationResponseInternal : /// string SwapPropertySwapSource { get; set; } /// Represent the term of reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } /// The applied scope type of the reservation for display, e.g. Shared string UserFriendlyAppliedScopeType { get; set; } /// The renew state of the reservation for display, e.g. On string UserFriendlyRenewState { get; set; } /// Reservation utilization - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization Utilization { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization Utilization { get; set; } /// The array of aggregates of a reservation's utilization - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[] UtilizationAggregate { get; set; } + System.Collections.Generic.List UtilizationAggregate { get; set; } /// last 7 day utilization trend for a reservation string UtilizationTrend { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.json.cs similarity index 86% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.json.cs index 66a9daa3a36e..c17e3c7f9934 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationResponse.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationResponse(json) : null; } @@ -77,12 +77,12 @@ internal ReservationResponse(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Run { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.Resource(json); - {_internalSkuName = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName.FromJson(__jsonSku) : InternalSkuName;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsProperties.FromJson(__jsonProperties) : Property;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (int?)__jsonEtag : Etag;} - {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ProxyResource(json); + {_internalSkuName = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName.FromJson(__jsonSku) : _internalSkuName;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsProperties.FromJson(__jsonProperties) : _property;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (int?)__jsonEtag : _etag;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)_kind;} AfterFromJson(json); } @@ -105,10 +105,13 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._internalSkuName ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._internalSkuName.ToJson(null,serializationMode) : null, "sku" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } AddIf( null != this._etag ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((int)this._etag) : null, "etag" ,container.Add ); AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); AfterToJson(ref container); diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.PowerShell.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.PowerShell.cs index 4f7e36d60b81..f14226af841c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ReservationSplitProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationSplitProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationSplitProperties(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,17 +111,17 @@ internal ReservationSplitProperties(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("SplitDestinations")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitPropertiesInternal)this).SplitDestinations = (string[]) content.GetValueForProperty("SplitDestinations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitPropertiesInternal)this).SplitDestinations, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitPropertiesInternal)this).SplitDestinations = (System.Collections.Generic.List) content.GetValueForProperty("SplitDestinations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitPropertiesInternal)this).SplitDestinations, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SplitSource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitPropertiesInternal)this).SplitSource = (string) content.GetValueForProperty("SplitSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitPropertiesInternal)this).SplitSource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitPropertiesInternal)this).SplitSource = (string) content.GetValueForProperty("SplitSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitPropertiesInternal)this).SplitSource, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,11 +136,11 @@ internal ReservationSplitProperties(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("SplitDestinations")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitPropertiesInternal)this).SplitDestinations = (string[]) content.GetValueForProperty("SplitDestinations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitPropertiesInternal)this).SplitDestinations, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitPropertiesInternal)this).SplitDestinations = (System.Collections.Generic.List) content.GetValueForProperty("SplitDestinations",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitPropertiesInternal)this).SplitDestinations, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SplitSource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitPropertiesInternal)this).SplitSource = (string) content.GetValueForProperty("SplitSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitPropertiesInternal)this).SplitSource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitPropertiesInternal)this).SplitSource = (string) content.GetValueForProperty("SplitSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitPropertiesInternal)this).SplitSource, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.TypeConverter.cs index 2abad1eb9bd3..9dde4c620c35 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.cs similarity index 85% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.cs index 791166516732..170b34d540bb 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.cs @@ -3,24 +3,24 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties of reservation split public partial class ReservationSplitProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitPropertiesInternal { /// Backing field for property. - private string[] _splitDestinations; + private System.Collections.Generic.List _splitDestinations; /// /// List of destination resource id that are created due to split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public string[] SplitDestinations { get => this._splitDestinations; set => this._splitDestinations = value; } + public System.Collections.Generic.List SplitDestinations { get => this._splitDestinations; set => this._splitDestinations = value; } /// Backing field for property. private string _splitSource; @@ -47,16 +47,22 @@ public partial interface IReservationSplitProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of destination resource id that are created due to split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"splitDestinations", PossibleTypes = new [] { typeof(string) })] - string[] SplitDestinations { get; set; } + System.Collections.Generic.List SplitDestinations { get; set; } /// /// Resource id of the reservation from which this is split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource id of the reservation from which this is split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"splitSource", PossibleTypes = new [] { typeof(string) })] @@ -70,7 +76,7 @@ internal partial interface IReservationSplitPropertiesInternal /// /// List of destination resource id that are created due to split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// - string[] SplitDestinations { get; set; } + System.Collections.Generic.List SplitDestinations { get; set; } /// /// Resource id of the reservation from which this is split. Format of the resource id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.json.cs index 2ff7239685b8..46ed34651f7c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSplitProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSplitProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationSplitProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationSplitProperties(json) : null; } @@ -77,8 +77,8 @@ internal ReservationSplitProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservati { return; } - {_splitDestinations = If( json?.PropertyT("splitDestinations"), out var __jsonSplitDestinations) ? If( __jsonSplitDestinations as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SplitDestinations;} - {_splitSource = If( json?.PropertyT("splitSource"), out var __jsonSplitSource) ? (string)__jsonSplitSource : (string)SplitSource;} + {_splitDestinations = If( json?.PropertyT("splitDestinations"), out var __jsonSplitDestinations) ? If( __jsonSplitDestinations as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _splitDestinations;} + {_splitSource = If( json?.PropertyT("splitSource"), out var __jsonSplitSource) ? (string)__jsonSplitSource : (string)_splitSource;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.PowerShell.cs similarity index 61% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.PowerShell.cs index 9c2a71384341..5fe3cf467bfc 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ReservationSummary partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationSummary(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationSummary(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,45 +111,45 @@ internal ReservationSummary(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SucceededCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).SucceededCount = (float?) content.GetValueForProperty("SucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).SucceededCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).SucceededCount = (float?) content.GetValueForProperty("SucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).SucceededCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("FailedCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).FailedCount = (float?) content.GetValueForProperty("FailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).FailedCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).FailedCount = (float?) content.GetValueForProperty("FailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).FailedCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("ExpiringCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ExpiringCount = (float?) content.GetValueForProperty("ExpiringCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ExpiringCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ExpiringCount = (float?) content.GetValueForProperty("ExpiringCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ExpiringCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("ExpiredCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ExpiredCount = (float?) content.GetValueForProperty("ExpiredCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ExpiredCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ExpiredCount = (float?) content.GetValueForProperty("ExpiredCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ExpiredCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("PendingCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).PendingCount = (float?) content.GetValueForProperty("PendingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).PendingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).PendingCount = (float?) content.GetValueForProperty("PendingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).PendingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("CancelledCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).CancelledCount = (float?) content.GetValueForProperty("CancelledCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).CancelledCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).CancelledCount = (float?) content.GetValueForProperty("CancelledCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).CancelledCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("ProcessingCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ProcessingCount = (float?) content.GetValueForProperty("ProcessingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ProcessingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ProcessingCount = (float?) content.GetValueForProperty("ProcessingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ProcessingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("WarningCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).WarningCount = (float?) content.GetValueForProperty("WarningCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).WarningCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).WarningCount = (float?) content.GetValueForProperty("WarningCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).WarningCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("NoBenefitCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).NoBenefitCount = (float?) content.GetValueForProperty("NoBenefitCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).NoBenefitCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).NoBenefitCount = (float?) content.GetValueForProperty("NoBenefitCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).NoBenefitCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -164,39 +164,39 @@ internal ReservationSummary(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("SucceededCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).SucceededCount = (float?) content.GetValueForProperty("SucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).SucceededCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).SucceededCount = (float?) content.GetValueForProperty("SucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).SucceededCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("FailedCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).FailedCount = (float?) content.GetValueForProperty("FailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).FailedCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).FailedCount = (float?) content.GetValueForProperty("FailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).FailedCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("ExpiringCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ExpiringCount = (float?) content.GetValueForProperty("ExpiringCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ExpiringCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ExpiringCount = (float?) content.GetValueForProperty("ExpiringCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ExpiringCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("ExpiredCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ExpiredCount = (float?) content.GetValueForProperty("ExpiredCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ExpiredCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ExpiredCount = (float?) content.GetValueForProperty("ExpiredCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ExpiredCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("PendingCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).PendingCount = (float?) content.GetValueForProperty("PendingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).PendingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).PendingCount = (float?) content.GetValueForProperty("PendingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).PendingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("CancelledCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).CancelledCount = (float?) content.GetValueForProperty("CancelledCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).CancelledCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).CancelledCount = (float?) content.GetValueForProperty("CancelledCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).CancelledCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("ProcessingCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ProcessingCount = (float?) content.GetValueForProperty("ProcessingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).ProcessingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ProcessingCount = (float?) content.GetValueForProperty("ProcessingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).ProcessingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("WarningCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).WarningCount = (float?) content.GetValueForProperty("WarningCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).WarningCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).WarningCount = (float?) content.GetValueForProperty("WarningCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).WarningCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("NoBenefitCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).NoBenefitCount = (float?) content.GetValueForProperty("NoBenefitCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)this).NoBenefitCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).NoBenefitCount = (float?) content.GetValueForProperty("NoBenefitCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)this).NoBenefitCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.TypeConverter.cs index b23553149019..13d321fc8389 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.cs similarity index 85% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.cs index 79a1ff0c5447..88203cc3ad68 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The roll up count summary of reservations in each state public partial class ReservationSummary : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal { /// Backing field for property. @@ -42,31 +42,31 @@ public partial class ReservationSummary : public float? FailedCount { get => this._failedCount; } /// Internal Acessors for CancelledCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal.CancelledCount { get => this._cancelledCount; set { {_cancelledCount = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal.CancelledCount { get => this._cancelledCount; set { {_cancelledCount = value;} } } /// Internal Acessors for ExpiredCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal.ExpiredCount { get => this._expiredCount; set { {_expiredCount = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal.ExpiredCount { get => this._expiredCount; set { {_expiredCount = value;} } } /// Internal Acessors for ExpiringCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal.ExpiringCount { get => this._expiringCount; set { {_expiringCount = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal.ExpiringCount { get => this._expiringCount; set { {_expiringCount = value;} } } /// Internal Acessors for FailedCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal.FailedCount { get => this._failedCount; set { {_failedCount = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal.FailedCount { get => this._failedCount; set { {_failedCount = value;} } } /// Internal Acessors for NoBenefitCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal.NoBenefitCount { get => this._noBenefitCount; set { {_noBenefitCount = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal.NoBenefitCount { get => this._noBenefitCount; set { {_noBenefitCount = value;} } } /// Internal Acessors for PendingCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal.PendingCount { get => this._pendingCount; set { {_pendingCount = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal.PendingCount { get => this._pendingCount; set { {_pendingCount = value;} } } /// Internal Acessors for ProcessingCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal.ProcessingCount { get => this._processingCount; set { {_processingCount = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal.ProcessingCount { get => this._processingCount; set { {_processingCount = value;} } } /// Internal Acessors for SucceededCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal.SucceededCount { get => this._succeededCount; set { {_succeededCount = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal.SucceededCount { get => this._succeededCount; set { {_succeededCount = value;} } } /// Internal Acessors for WarningCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal.WarningCount { get => this._warningCount; set { {_warningCount = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal.WarningCount { get => this._warningCount; set { {_warningCount = value;} } } /// Backing field for property. private float? _noBenefitCount; @@ -117,6 +117,9 @@ public partial interface IReservationSummary : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Cancelled state", SerializedName = @"cancelledCount", PossibleTypes = new [] { typeof(float) })] @@ -125,6 +128,9 @@ public partial interface IReservationSummary : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Expired state", SerializedName = @"expiredCount", PossibleTypes = new [] { typeof(float) })] @@ -133,6 +139,9 @@ public partial interface IReservationSummary : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Expiring state", SerializedName = @"expiringCount", PossibleTypes = new [] { typeof(float) })] @@ -141,6 +150,9 @@ public partial interface IReservationSummary : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Failed state", SerializedName = @"failedCount", PossibleTypes = new [] { typeof(float) })] @@ -149,6 +161,9 @@ public partial interface IReservationSummary : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in NoBenefit state", SerializedName = @"noBenefitCount", PossibleTypes = new [] { typeof(float) })] @@ -157,6 +172,9 @@ public partial interface IReservationSummary : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Pending state", SerializedName = @"pendingCount", PossibleTypes = new [] { typeof(float) })] @@ -165,6 +183,9 @@ public partial interface IReservationSummary : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Processing state", SerializedName = @"processingCount", PossibleTypes = new [] { typeof(float) })] @@ -173,6 +194,9 @@ public partial interface IReservationSummary : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Succeeded state", SerializedName = @"succeededCount", PossibleTypes = new [] { typeof(float) })] @@ -181,6 +205,9 @@ public partial interface IReservationSummary : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Warning state", SerializedName = @"warningCount", PossibleTypes = new [] { typeof(float) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.json.cs index 4f17af855208..4661391b19c3 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSummary.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSummary.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationSummary partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationSummary(json) : null; } @@ -77,15 +77,15 @@ internal ReservationSummary(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runt { return; } - {_succeededCount = If( json?.PropertyT("succeededCount"), out var __jsonSucceededCount) ? (float?)__jsonSucceededCount : SucceededCount;} - {_failedCount = If( json?.PropertyT("failedCount"), out var __jsonFailedCount) ? (float?)__jsonFailedCount : FailedCount;} - {_expiringCount = If( json?.PropertyT("expiringCount"), out var __jsonExpiringCount) ? (float?)__jsonExpiringCount : ExpiringCount;} - {_expiredCount = If( json?.PropertyT("expiredCount"), out var __jsonExpiredCount) ? (float?)__jsonExpiredCount : ExpiredCount;} - {_pendingCount = If( json?.PropertyT("pendingCount"), out var __jsonPendingCount) ? (float?)__jsonPendingCount : PendingCount;} - {_cancelledCount = If( json?.PropertyT("cancelledCount"), out var __jsonCancelledCount) ? (float?)__jsonCancelledCount : CancelledCount;} - {_processingCount = If( json?.PropertyT("processingCount"), out var __jsonProcessingCount) ? (float?)__jsonProcessingCount : ProcessingCount;} - {_warningCount = If( json?.PropertyT("warningCount"), out var __jsonWarningCount) ? (float?)__jsonWarningCount : WarningCount;} - {_noBenefitCount = If( json?.PropertyT("noBenefitCount"), out var __jsonNoBenefitCount) ? (float?)__jsonNoBenefitCount : NoBenefitCount;} + {_succeededCount = If( json?.PropertyT("succeededCount"), out var __jsonSucceededCount) ? (float?)__jsonSucceededCount : _succeededCount;} + {_failedCount = If( json?.PropertyT("failedCount"), out var __jsonFailedCount) ? (float?)__jsonFailedCount : _failedCount;} + {_expiringCount = If( json?.PropertyT("expiringCount"), out var __jsonExpiringCount) ? (float?)__jsonExpiringCount : _expiringCount;} + {_expiredCount = If( json?.PropertyT("expiredCount"), out var __jsonExpiredCount) ? (float?)__jsonExpiredCount : _expiredCount;} + {_pendingCount = If( json?.PropertyT("pendingCount"), out var __jsonPendingCount) ? (float?)__jsonPendingCount : _pendingCount;} + {_cancelledCount = If( json?.PropertyT("cancelledCount"), out var __jsonCancelledCount) ? (float?)__jsonCancelledCount : _cancelledCount;} + {_processingCount = If( json?.PropertyT("processingCount"), out var __jsonProcessingCount) ? (float?)__jsonProcessingCount : _processingCount;} + {_warningCount = If( json?.PropertyT("warningCount"), out var __jsonWarningCount) ? (float?)__jsonWarningCount : _warningCount;} + {_noBenefitCount = If( json?.PropertyT("noBenefitCount"), out var __jsonNoBenefitCount) ? (float?)__jsonNoBenefitCount : _noBenefitCount;} AfterFromJson(json); } @@ -108,39 +108,39 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._succeededCount ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._succeededCount) : null, "succeededCount" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._failedCount ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._failedCount) : null, "failedCount" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._expiringCount ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._expiringCount) : null, "expiringCount" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._expiredCount ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._expiredCount) : null, "expiredCount" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._pendingCount ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._pendingCount) : null, "pendingCount" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._cancelledCount ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._cancelledCount) : null, "cancelledCount" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._processingCount ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._processingCount) : null, "processingCount" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._warningCount ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._warningCount) : null, "warningCount" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._noBenefitCount ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._noBenefitCount) : null, "noBenefitCount" ,container.Add ); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.PowerShell.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.PowerShell.cs index c14e847c328d..c4d94bae3938 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ReservationSwapProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationSwapProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationSwapProperties(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,17 +111,17 @@ internal ReservationSwapProperties(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("SwapSource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)this).SwapSource = (string) content.GetValueForProperty("SwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)this).SwapSource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)this).SwapSource = (string) content.GetValueForProperty("SwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)this).SwapSource, global::System.Convert.ToString); } if (content.Contains("SwapDestination")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)this).SwapDestination = (string) content.GetValueForProperty("SwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)this).SwapDestination, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)this).SwapDestination = (string) content.GetValueForProperty("SwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)this).SwapDestination, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,11 +136,11 @@ internal ReservationSwapProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("SwapSource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)this).SwapSource = (string) content.GetValueForProperty("SwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)this).SwapSource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)this).SwapSource = (string) content.GetValueForProperty("SwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)this).SwapSource, global::System.Convert.ToString); } if (content.Contains("SwapDestination")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)this).SwapDestination = (string) content.GetValueForProperty("SwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)this).SwapDestination, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)this).SwapDestination = (string) content.GetValueForProperty("SwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)this).SwapDestination, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.TypeConverter.cs index 8e3be113a250..7329ba757f4e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.cs index b959833b3253..b3273cb80f37 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties of reservation swap public partial class ReservationSwapProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal { /// Backing field for property. @@ -47,6 +47,9 @@ public partial interface IReservationSwapProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"swapDestination", PossibleTypes = new [] { typeof(string) })] @@ -57,6 +60,9 @@ public partial interface IReservationSwapProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"swapSource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.json.cs similarity index 95% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.json.cs index 3170bda2330e..38a12d9bdb03 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationSwapProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationSwapProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationSwapProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationSwapProperties(json) : null; } @@ -77,8 +77,8 @@ internal ReservationSwapProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservatio { return; } - {_swapSource = If( json?.PropertyT("swapSource"), out var __jsonSwapSource) ? (string)__jsonSwapSource : (string)SwapSource;} - {_swapDestination = If( json?.PropertyT("swapDestination"), out var __jsonSwapDestination) ? (string)__jsonSwapDestination : (string)SwapDestination;} + {_swapSource = If( json?.PropertyT("swapSource"), out var __jsonSwapSource) ? (string)__jsonSwapSource : (string)_swapSource;} + {_swapDestination = If( json?.PropertyT("swapDestination"), out var __jsonSwapDestination) ? (string)__jsonSwapDestination : (string)_swapDestination;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.PowerShell.cs similarity index 69% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.PowerShell.cs index 9d8ee80868b9..ce62568dee8f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ReservationToExchange partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationToExchange(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationToExchange(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,25 +111,25 @@ internal ReservationToExchange(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).ReservationId, global::System.Convert.ToString); } if (content.Contains("Quantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("BillingRefundAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingInformation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.BillingInformationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.BillingInformationTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,19 +144,19 @@ internal ReservationToExchange(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).ReservationId, global::System.Convert.ToString); } if (content.Contains("Quantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("BillingRefundAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingInformation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.BillingInformationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.BillingInformationTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.TypeConverter.cs index 5bc73f351bf4..284138842534 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.cs similarity index 75% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.cs index f15edb3244c8..c5186fac7535 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.cs @@ -3,29 +3,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Reservation refund details public partial class ReservationToExchange : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchangeInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchangeInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation _billingInformation; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation _billingInformation; /// billing information [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation BillingInformation { get => (this._billingInformation = this._billingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.BillingInformation()); set => this._billingInformation = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation BillingInformation { get => (this._billingInformation = this._billingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.BillingInformation()); set => this._billingInformation = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingRefundAmount; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingRefundAmount; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get => (this._billingRefundAmount = this._billingRefundAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingRefundAmount = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get => (this._billingRefundAmount = this._billingRefundAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingRefundAmount = value; } /// Backing field for property. private int? _quantity; @@ -55,22 +55,31 @@ public partial interface IReservationToExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"billing information", SerializedName = @"billingInformation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation BillingInformation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation BillingInformation { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingRefundAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get; set; } /// Quantity to be returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity to be returned", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -79,6 +88,9 @@ public partial interface IReservationToExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified id of the reservation being returned.", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] @@ -90,9 +102,9 @@ internal partial interface IReservationToExchangeInternal { /// billing information - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation BillingInformation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation BillingInformation { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get; set; } /// Quantity to be returned int? Quantity { get; set; } /// Fully qualified id of the reservation being returned. diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.json.cs index e45b21957636..91ebc81af2f3 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToExchange.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToExchange.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationToExchange partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationToExchange(json) : null; } @@ -77,10 +77,10 @@ internal ReservationToExchange(Microsoft.Azure.PowerShell.Cmdlets.Reservations.R { return; } - {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)ReservationId;} - {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : Quantity;} - {_billingRefundAmount = If( json?.PropertyT("billingRefundAmount"), out var __jsonBillingRefundAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingRefundAmount) : BillingRefundAmount;} - {_billingInformation = If( json?.PropertyT("billingInformation"), out var __jsonBillingInformation) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.BillingInformation.FromJson(__jsonBillingInformation) : BillingInformation;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)_reservationId;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : _quantity;} + {_billingRefundAmount = If( json?.PropertyT("billingRefundAmount"), out var __jsonBillingRefundAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingRefundAmount) : _billingRefundAmount;} + {_billingInformation = If( json?.PropertyT("billingInformation"), out var __jsonBillingInformation) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.BillingInformation.FromJson(__jsonBillingInformation) : _billingInformation;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.PowerShell.cs new file mode 100644 index 000000000000..55ce410dd47e --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.PowerShell.cs @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// Reservation purchase details + [System.ComponentModel.TypeConverter(typeof(ReservationToPurchaseCalculateExchangeTypeConverter))] + public partial class ReservationToPurchaseCalculateExchange + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationToPurchaseCalculateExchange(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.Reservations.Models.IReservationToPurchaseCalculateExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationToPurchaseCalculateExchange(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.Reservations.Models.IReservationToPurchaseCalculateExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationToPurchaseCalculateExchange(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.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom); + } + if (content.Contains("BillingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PurchaseRequestProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).PurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties) content.GetValueForProperty("PurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).PurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScope = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourcePropertyInstanceFlexibility = (string) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourcePropertyInstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId, 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 ReservationToPurchaseCalculateExchange(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.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom); + } + if (content.Contains("BillingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("PurchaseRequestProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).PurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties) content.GetValueForProperty("PurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).PurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScope = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties) content.GetValueForProperty("ReservedResourceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestPropertiesReservedResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("ReservedResourcePropertyInstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourcePropertyInstanceFlexibility = (string) content.GetValueForProperty("ReservedResourcePropertyInstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).ReservedResourcePropertyInstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId, 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Reservation purchase details + [System.ComponentModel.TypeConverter(typeof(ReservationToPurchaseCalculateExchangeTypeConverter))] + public partial interface IReservationToPurchaseCalculateExchange + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.TypeConverter.cs index 7b0f8d37fbb0..a63ccdf2ffa6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchange ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchange).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.cs similarity index 59% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.cs index af7d6671b48a..5daa681003fe 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Reservation purchase details public partial class ReservationToPurchaseCalculateExchange : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchange, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal { /// @@ -18,110 +18,110 @@ public partial class ReservationToPurchaseCalculateExchange : /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string[] AppliedScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopes; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopes = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AppliedScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopes; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopes = value ?? null /* arrayOf */; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopePropertyTenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopePropertyTenantId = value ?? null; } /// Type of the Applied Scope. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopeType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); } + public string AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopeType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyTotal; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyTotal = value; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).BillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); } + public string BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).BillingPlan = value ?? null; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).BillingScopeId = value ?? null; } + public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).BillingScopeId = value ?? null; } /// Friendly name of the reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).DisplayName = value ?? null; } /// The Azure region where the reserved resource lives. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Location = value ?? null; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).AppliedScopeProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).AppliedScopeProperty = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest()); set { {_property = value;} } } /// Internal Acessors for PurchaseRequestProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal.PurchaseRequestProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Properties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Properties = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal.PurchaseRequestProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Properties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Properties = value; } /// Internal Acessors for ReservedResourceProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal.ReservedResourceProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).ReservedResourceProperties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).ReservedResourceProperties = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal.ReservedResourceProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).ReservedResourceProperties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).ReservedResourceProperties = value; } /// Internal Acessors for Sku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchangeInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).InternalSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).InternalSkuName = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchangeInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).InternalSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).InternalSkuName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest _property; /// The request for reservation purchase [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest()); set => this._property = value; } /// Quantity of the skus that are part of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Quantity = value ?? default(int); } + public int? Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Quantity = value ?? default(int); } /// /// Setting this to true will automatically purchase a new reservation on the expiration date time. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public bool? Renew { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Renew; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Renew = value ?? default(bool); } + public bool? Renew { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Renew; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Renew = value ?? default(bool); } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? ReservedResourcePropertyInstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).InstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).InstanceFlexibility = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); } + public string ReservedResourcePropertyInstanceFlexibility { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).InstanceFlexibility; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).InstanceFlexibility = value ?? null; } /// The type of the resource that is being reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).ReservedResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).ReservedResourceType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType)""); } + public string ReservedResourceType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).ReservedResourceType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).ReservedResourceType = value ?? null; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).ReviewDateTime = value ?? default(global::System.DateTime); } + public global::System.DateTime? ReviewDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).ReviewDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).ReviewDateTime = value ?? default(global::System.DateTime); } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Sku = value ?? null; } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Sku; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Sku = value ?? null; } /// Represent the term of reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestInternal)Property).Term = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm)""); } + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestInternal)Property).Term = value ?? null; } /// Creates an new instance. public ReservationToPurchaseCalculateExchange() @@ -140,14 +140,20 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - string[] AppliedScope { get; set; } + System.Collections.Generic.List AppliedScope { get; set; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -158,6 +164,9 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -166,6 +175,9 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -174,6 +186,9 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -182,6 +197,9 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -190,30 +208,44 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get; set; } /// Represent the billing plans. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription that will be charged for purchasing reservation or savings plan", SerializedName = @"billingScopeId", PossibleTypes = new [] { typeof(string) })] @@ -222,6 +254,9 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name of the reservation", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -230,6 +265,9 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The Azure region where the reserved resource lives.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -238,6 +276,9 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity of the skus that are part of the reservation.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -248,6 +289,9 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Setting this to true will automatically purchase a new reservation on the expiration date time.", SerializedName = @"renew", PossibleTypes = new [] { typeof(bool) })] @@ -259,22 +303,33 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? ReservedResourcePropertyInstanceFlexibility { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string ReservedResourcePropertyInstanceFlexibility { get; set; } /// The type of the resource that is being reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the resource that is being reserved.", SerializedName = @"reservedResourceType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the Azure hybrid benefit needs to be reviewed.", SerializedName = @"reviewDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -283,6 +338,9 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -291,10 +349,14 @@ public partial interface IReservationToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } } /// Reservation purchase details @@ -305,12 +367,12 @@ internal partial interface IReservationToPurchaseCalculateExchangeInternal /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. /// - string[] AppliedScope { get; set; } + System.Collections.Generic.List AppliedScope { get; set; } /// /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -324,11 +386,13 @@ internal partial interface IReservationToPurchaseCalculateExchangeInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// Type of the Applied Scope. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get; set; } /// Represent the billing plans. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan string BillingScopeId { get; set; } /// Friendly name of the reservation @@ -336,9 +400,9 @@ internal partial interface IReservationToPurchaseCalculateExchangeInternal /// The Azure region where the reserved resource lives. string Location { get; set; } /// The request for reservation purchase - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest Property { get; set; } /// Properties of reservation purchase request - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestProperties PurchaseRequestProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestProperties PurchaseRequestProperty { get; set; } /// Quantity of the skus that are part of the reservation. int? Quantity { get; set; } /// @@ -348,22 +412,25 @@ internal partial interface IReservationToPurchaseCalculateExchangeInternal /// /// Properties specific to each reserved resource type. Not required if not applicable. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequestPropertiesReservedResourceProperties ReservedResourceProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequestPropertiesReservedResourceProperties ReservedResourceProperty { get; set; } /// /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines /// reserved resource type. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? ReservedResourcePropertyInstanceFlexibility { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string ReservedResourcePropertyInstanceFlexibility { get; set; } /// The type of the resource that is being reserved. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. global::System.DateTime? ReviewDateTime { get; set; } /// The name of sku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName Sku { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName Sku { get; set; } string SkuName { get; set; } /// Represent the term of reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.json.cs index 9adbf6f4a8c2..cc7049dfb91f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseCalculateExchange.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseCalculateExchange.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationToPurchaseCalculateExchange partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchange. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchange. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseCalculateExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseCalculateExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationToPurchaseCalculateExchange(json) : null; } @@ -77,8 +77,8 @@ internal ReservationToPurchaseCalculateExchange(Microsoft.Azure.PowerShell.Cmdle { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest.FromJson(__jsonProperties) : Property;} - {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyTotal) : BillingCurrencyTotal;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest.FromJson(__jsonProperties) : _property;} + {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyTotal) : _billingCurrencyTotal;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.PowerShell.cs similarity index 65% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.PowerShell.cs index c112ab1953ab..9e6aacb10b26 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ReservationToPurchaseExchange partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationToPurchaseExchange(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationToPurchaseExchange(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,29 +111,29 @@ internal ReservationToPurchaseExchange(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).ReservationOrderId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).ReservationOrderId, global::System.Convert.ToString); } if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).ReservationId, global::System.Convert.ToString); } if (content.Contains("Properties")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -150,23 +148,23 @@ internal ReservationToPurchaseExchange(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("ReservationOrderId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).ReservationOrderId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).ReservationOrderId = (string) content.GetValueForProperty("ReservationOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).ReservationOrderId, global::System.Convert.ToString); } if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).ReservationId, global::System.Convert.ToString); } if (content.Contains("Properties")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequestTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequestTypeConverter.ConvertFrom); } if (content.Contains("BillingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.TypeConverter.cs index e53cfdf6b88b..c74fe32cb489 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.cs similarity index 74% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.cs index 8606abfea2f8..072a842468b5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.cs @@ -3,29 +3,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Reservation purchase details public partial class ReservationToPurchaseExchange : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchangeInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchangeInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyTotal; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyTotal = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest _properties; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest _properties; /// The request for reservation purchase [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest()); set => this._properties = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest()); set => this._properties = value; } /// Backing field for property. private string _reservationId; @@ -45,11 +45,11 @@ public partial class ReservationToPurchaseExchange : public string ReservationOrderId { get => this._reservationOrderId; set => this._reservationOrderId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? _status; + private string _status; /// Status of the individual operation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Creates an new instance. public ReservationToPurchaseExchange() @@ -65,18 +65,24 @@ public partial interface IReservationToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get; set; } /// The request for reservation purchase [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The request for reservation purchase", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest Properties { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest Properties { get; set; } /// /// Fully qualified id of the reservation being purchased. This value is only guaranteed to be non-null if the purchase is /// successful. @@ -84,6 +90,9 @@ public partial interface IReservationToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified id of the reservation being purchased. This value is only guaranteed to be non-null if the purchase is successful.", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +101,9 @@ public partial interface IReservationToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified id of the reservationOrder being purchased", SerializedName = @"reservationOrderId", PossibleTypes = new [] { typeof(string) })] @@ -100,10 +112,14 @@ public partial interface IReservationToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Status of the individual operation.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending")] + string Status { get; set; } } /// Reservation purchase details @@ -111,9 +127,9 @@ internal partial interface IReservationToPurchaseExchangeInternal { /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get; set; } /// The request for reservation purchase - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest Properties { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest Properties { get; set; } /// /// Fully qualified id of the reservation being purchased. This value is only guaranteed to be non-null if the purchase is /// successful. @@ -122,7 +138,8 @@ internal partial interface IReservationToPurchaseExchangeInternal /// Fully qualified id of the reservationOrder being purchased string ReservationOrderId { get; set; } /// Status of the individual operation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.json.cs index 0cb068e163e9..11f055300184 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToPurchaseExchange.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToPurchaseExchange.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationToPurchaseExchange partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToPurchaseExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToPurchaseExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationToPurchaseExchange(json) : null; } @@ -77,11 +77,11 @@ internal ReservationToPurchaseExchange(Microsoft.Azure.PowerShell.Cmdlets.Reserv { 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;} - {_properties = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest.FromJson(__jsonProperties) : Properties;} - {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyTotal) : BillingCurrencyTotal;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_reservationOrderId = If( json?.PropertyT("reservationOrderId"), out var __jsonReservationOrderId) ? (string)__jsonReservationOrderId : (string)_reservationOrderId;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)_reservationId;} + {_properties = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest.FromJson(__jsonProperties) : _properties;} + {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyTotal) : _billingCurrencyTotal;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.PowerShell.cs similarity index 80% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.PowerShell.cs index f654b489a7ee..653ed688e150 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ReservationToReturn partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationToReturn(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationToReturn(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal ReservationToReturn(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)this).ReservationId, global::System.Convert.ToString); } if (content.Contains("Quantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal ReservationToReturn(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)this).ReservationId, global::System.Convert.ToString); } if (content.Contains("Quantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.TypeConverter.cs index 7cccc7911757..50cea9415591 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.cs index 186da90fff1c..a069a7d701c4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Reservation to return public partial class ReservationToReturn : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IReservationToReturn : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity to be returned. Must be greater than zero.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -49,6 +52,9 @@ public partial interface IReservationToReturn : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified identifier of the reservation being returned", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.json.cs index a823280be03f..8c5b41cc743a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturn.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturn.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationToReturn partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationToReturn(json) : null; } @@ -77,8 +77,8 @@ internal ReservationToReturn(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Run { return; } - {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)ReservationId;} - {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : Quantity;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)_reservationId;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : _quantity;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.PowerShell.cs similarity index 65% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.PowerShell.cs index a6d2a43551b8..ae3ae45c574f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ReservationToReturnForExchange partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationToReturnForExchange(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationToReturnForExchange(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,29 +111,29 @@ internal ReservationToReturnForExchange(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).ReservationId, global::System.Convert.ToString); } if (content.Contains("Quantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("BillingRefundAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingInformation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.BillingInformationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.BillingInformationTypeConverter.ConvertFrom); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).Status, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -150,23 +148,23 @@ internal ReservationToReturnForExchange(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).ReservationId, global::System.Convert.ToString); } if (content.Contains("Quantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("BillingRefundAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PriceTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).BillingRefundAmount = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingRefundAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).BillingRefundAmount, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } if (content.Contains("BillingInformation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.BillingInformationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).BillingInformation = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation) content.GetValueForProperty("BillingInformation",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).BillingInformation, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.BillingInformationTypeConverter.ConvertFrom); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.TypeConverter.cs index 2d7185e9f33e..fa681426c7d2 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.cs similarity index 71% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.cs index 5fca03b45c8f..7e255e9674ec 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.cs @@ -3,29 +3,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Reservation refund details public partial class ReservationToReturnForExchange : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchangeInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchangeInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation _billingInformation; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation _billingInformation; /// billing information [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation BillingInformation { get => (this._billingInformation = this._billingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.BillingInformation()); set => this._billingInformation = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation BillingInformation { get => (this._billingInformation = this._billingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.BillingInformation()); set => this._billingInformation = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingRefundAmount; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingRefundAmount; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get => (this._billingRefundAmount = this._billingRefundAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingRefundAmount = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get => (this._billingRefundAmount = this._billingRefundAmount ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingRefundAmount = value; } /// Backing field for property. private int? _quantity; @@ -42,11 +42,11 @@ public partial class ReservationToReturnForExchange : public string ReservationId { get => this._reservationId; set => this._reservationId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? _status; + private string _status; /// Status of the individual operation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Creates an new instance. public ReservationToReturnForExchange() @@ -62,22 +62,31 @@ public partial interface IReservationToReturnForExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"billing information", SerializedName = @"billingInformation", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation BillingInformation { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation BillingInformation { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingRefundAmount", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get; set; } /// Quantity to be returned [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity to be returned", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -86,6 +95,9 @@ public partial interface IReservationToReturnForExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified id of the reservation being returned.", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] @@ -94,10 +106,14 @@ public partial interface IReservationToReturnForExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Status of the individual operation.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending")] + string Status { get; set; } } /// Reservation refund details @@ -105,15 +121,16 @@ internal partial interface IReservationToReturnForExchangeInternal { /// billing information - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IBillingInformation BillingInformation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IBillingInformation BillingInformation { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingRefundAmount { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingRefundAmount { get; set; } /// Quantity to be returned int? Quantity { get; set; } /// Fully qualified id of the reservation being returned. string ReservationId { get; set; } /// Status of the individual operation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending")] + string Status { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.json.cs similarity index 91% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.json.cs index 229ffeba5814..39e99f03ff0e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationToReturnForExchange.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationToReturnForExchange.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationToReturnForExchange partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturnForExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturnForExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationToReturnForExchange(json) : null; } @@ -77,11 +77,11 @@ internal ReservationToReturnForExchange(Microsoft.Azure.PowerShell.Cmdlets.Reser { return; } - {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)ReservationId;} - {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : Quantity;} - {_billingRefundAmount = If( json?.PropertyT("billingRefundAmount"), out var __jsonBillingRefundAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingRefundAmount) : BillingRefundAmount;} - {_billingInformation = If( json?.PropertyT("billingInformation"), out var __jsonBillingInformation) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.BillingInformation.FromJson(__jsonBillingInformation) : BillingInformation;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)_reservationId;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : _quantity;} + {_billingRefundAmount = If( json?.PropertyT("billingRefundAmount"), out var __jsonBillingRefundAmount) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingRefundAmount) : _billingRefundAmount;} + {_billingInformation = If( json?.PropertyT("billingInformation"), out var __jsonBillingInformation) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.BillingInformation.FromJson(__jsonBillingInformation) : _billingInformation;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.PowerShell.cs similarity index 72% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.PowerShell.cs index 2fa5b92d1676..5dde8c300158 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ReservationUtilizationAggregates partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationUtilizationAggregates(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationUtilizationAggregates(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,25 +111,25 @@ internal ReservationUtilizationAggregates(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Grain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).Grain = (float?) content.GetValueForProperty("Grain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).Grain, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).Grain = (float?) content.GetValueForProperty("Grain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).Grain, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("GrainUnit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).GrainUnit = (string) content.GetValueForProperty("GrainUnit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).GrainUnit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).GrainUnit = (string) content.GetValueForProperty("GrainUnit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).GrainUnit, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).Value = (float?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).Value, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).Value = (float?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).Value, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("ValueUnit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).ValueUnit = (string) content.GetValueForProperty("ValueUnit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).ValueUnit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).ValueUnit = (string) content.GetValueForProperty("ValueUnit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).ValueUnit, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -146,19 +144,19 @@ internal ReservationUtilizationAggregates(global::System.Management.Automation.P // actually deserialize if (content.Contains("Grain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).Grain = (float?) content.GetValueForProperty("Grain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).Grain, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).Grain = (float?) content.GetValueForProperty("Grain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).Grain, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("GrainUnit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).GrainUnit = (string) content.GetValueForProperty("GrainUnit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).GrainUnit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).GrainUnit = (string) content.GetValueForProperty("GrainUnit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).GrainUnit, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).Value = (float?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).Value, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).Value = (float?) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).Value, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("ValueUnit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).ValueUnit = (string) content.GetValueForProperty("ValueUnit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal)this).ValueUnit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).ValueUnit = (string) content.GetValueForProperty("ValueUnit",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal)this).ValueUnit, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.TypeConverter.cs index 85bf12c611bf..a2e38162b0a5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.cs similarity index 84% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.cs index 93d36f1e2b6f..10ded11c93da 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The aggregate values of reservation utilization public partial class ReservationUtilizationAggregates : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal { /// Backing field for property. @@ -28,16 +28,16 @@ public partial class ReservationUtilizationAggregates : public string GrainUnit { get => this._grainUnit; } /// Internal Acessors for Grain - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal.Grain { get => this._grain; set { {_grain = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal.Grain { get => this._grain; set { {_grain = value;} } } /// Internal Acessors for GrainUnit - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal.GrainUnit { get => this._grainUnit; set { {_grainUnit = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal.GrainUnit { get => this._grainUnit; set { {_grainUnit = value;} } } /// Internal Acessors for Value - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal.Value { get => this._value; set { {_value = value;} } } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal.Value { get => this._value; set { {_value = value;} } } /// Internal Acessors for ValueUnit - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregatesInternal.ValueUnit { get => this._valueUnit; set { {_valueUnit = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregatesInternal.ValueUnit { get => this._valueUnit; set { {_valueUnit = value;} } } /// Backing field for property. private float? _value; @@ -67,6 +67,9 @@ public partial interface IReservationUtilizationAggregates : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The grain of the aggregate", SerializedName = @"grain", PossibleTypes = new [] { typeof(float) })] @@ -75,6 +78,9 @@ public partial interface IReservationUtilizationAggregates : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The grain unit of the aggregate", SerializedName = @"grainUnit", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IReservationUtilizationAggregates : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The aggregate value", SerializedName = @"value", PossibleTypes = new [] { typeof(float) })] @@ -91,6 +100,9 @@ public partial interface IReservationUtilizationAggregates : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The aggregate value unit", SerializedName = @"valueUnit", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.json.cs index a8e28aaf3d5d..abea289c7ec0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationUtilizationAggregates.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationUtilizationAggregates.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationUtilizationAggregates partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationUtilizationAggregates(json) : null; } @@ -77,10 +77,10 @@ internal ReservationUtilizationAggregates(Microsoft.Azure.PowerShell.Cmdlets.Res { return; } - {_grain = If( json?.PropertyT("grain"), out var __jsonGrain) ? (float?)__jsonGrain : Grain;} - {_grainUnit = If( json?.PropertyT("grainUnit"), out var __jsonGrainUnit) ? (string)__jsonGrainUnit : (string)GrainUnit;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (float?)__jsonValue : Value;} - {_valueUnit = If( json?.PropertyT("valueUnit"), out var __jsonValueUnit) ? (string)__jsonValueUnit : (string)ValueUnit;} + {_grain = If( json?.PropertyT("grain"), out var __jsonGrain) ? (float?)__jsonGrain : _grain;} + {_grainUnit = If( json?.PropertyT("grainUnit"), out var __jsonGrainUnit) ? (string)__jsonGrainUnit : (string)_grainUnit;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (float?)__jsonValue : _value;} + {_valueUnit = If( json?.PropertyT("valueUnit"), out var __jsonValueUnit) ? (string)__jsonValueUnit : (string)_valueUnit;} AfterFromJson(json); } @@ -103,19 +103,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._grain ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._grain) : null, "grain" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._grainUnit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._grainUnit.ToString()) : null, "grainUnit" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._value ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber((float)this._value) : null, "value" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._valueUnit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._valueUnit.ToString()) : null, "valueUnit" ,container.Add ); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsIdentity.cs index bcf6f80393fe..b432f68c1fa8 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsIdentity.cs @@ -53,6 +53,9 @@ public partial interface IReservationsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -61,6 +64,9 @@ public partial interface IReservationsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the reservation item", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +75,9 @@ public partial interface IReservationsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Order Id of the reservation", SerializedName = @"reservationOrderId", PossibleTypes = new [] { typeof(string) })] @@ -77,6 +86,9 @@ public partial interface IReservationsIdentity : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Id of the subscription", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsIdentity.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsIdentity.json.cs index 82b600b43104..be600893fa1c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsIdentity.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsIdentity.json.cs @@ -76,10 +76,10 @@ internal ReservationsIdentity(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Ru { 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;} - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_reservationOrderId = If( json?.PropertyT("reservationOrderId"), out var __jsonReservationOrderId) ? (string)__jsonReservationOrderId : (string)_reservationOrderId;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)_reservationId;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.PowerShell.cs similarity index 54% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.PowerShell.cs index 78fedca28af5..3351a490801f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class ReservationsListResult partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationsListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationsListResult(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -115,57 +113,57 @@ internal ReservationsListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Summary")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).Summary = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary) content.GetValueForProperty("Summary",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).Summary, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSummaryTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).Summary = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary) content.GetValueForProperty("Summary",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).Summary, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSummaryTypeConverter.ConvertFrom); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponseTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("SummarySucceededCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummarySucceededCount = (float?) content.GetValueForProperty("SummarySucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummarySucceededCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummarySucceededCount = (float?) content.GetValueForProperty("SummarySucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummarySucceededCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryFailedCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryFailedCount = (float?) content.GetValueForProperty("SummaryFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryFailedCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryFailedCount = (float?) content.GetValueForProperty("SummaryFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryFailedCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryExpiringCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryExpiringCount = (float?) content.GetValueForProperty("SummaryExpiringCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryExpiringCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryExpiringCount = (float?) content.GetValueForProperty("SummaryExpiringCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryExpiringCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryExpiredCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryExpiredCount = (float?) content.GetValueForProperty("SummaryExpiredCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryExpiredCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryExpiredCount = (float?) content.GetValueForProperty("SummaryExpiredCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryExpiredCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryPendingCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryPendingCount = (float?) content.GetValueForProperty("SummaryPendingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryPendingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryPendingCount = (float?) content.GetValueForProperty("SummaryPendingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryPendingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryCancelledCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryCancelledCount = (float?) content.GetValueForProperty("SummaryCancelledCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryCancelledCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryCancelledCount = (float?) content.GetValueForProperty("SummaryCancelledCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryCancelledCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryProcessingCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryProcessingCount = (float?) content.GetValueForProperty("SummaryProcessingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryProcessingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryProcessingCount = (float?) content.GetValueForProperty("SummaryProcessingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryProcessingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryWarningCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryWarningCount = (float?) content.GetValueForProperty("SummaryWarningCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryWarningCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryWarningCount = (float?) content.GetValueForProperty("SummaryWarningCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryWarningCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryNoBenefitCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryNoBenefitCount = (float?) content.GetValueForProperty("SummaryNoBenefitCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryNoBenefitCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryNoBenefitCount = (float?) content.GetValueForProperty("SummaryNoBenefitCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryNoBenefitCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -180,51 +178,51 @@ internal ReservationsListResult(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Summary")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).Summary = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary) content.GetValueForProperty("Summary",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).Summary, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSummaryTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).Summary = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary) content.GetValueForProperty("Summary",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).Summary, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSummaryTypeConverter.ConvertFrom); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponseTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("SummarySucceededCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummarySucceededCount = (float?) content.GetValueForProperty("SummarySucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummarySucceededCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummarySucceededCount = (float?) content.GetValueForProperty("SummarySucceededCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummarySucceededCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryFailedCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryFailedCount = (float?) content.GetValueForProperty("SummaryFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryFailedCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryFailedCount = (float?) content.GetValueForProperty("SummaryFailedCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryFailedCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryExpiringCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryExpiringCount = (float?) content.GetValueForProperty("SummaryExpiringCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryExpiringCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryExpiringCount = (float?) content.GetValueForProperty("SummaryExpiringCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryExpiringCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryExpiredCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryExpiredCount = (float?) content.GetValueForProperty("SummaryExpiredCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryExpiredCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryExpiredCount = (float?) content.GetValueForProperty("SummaryExpiredCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryExpiredCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryPendingCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryPendingCount = (float?) content.GetValueForProperty("SummaryPendingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryPendingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryPendingCount = (float?) content.GetValueForProperty("SummaryPendingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryPendingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryCancelledCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryCancelledCount = (float?) content.GetValueForProperty("SummaryCancelledCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryCancelledCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryCancelledCount = (float?) content.GetValueForProperty("SummaryCancelledCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryCancelledCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryProcessingCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryProcessingCount = (float?) content.GetValueForProperty("SummaryProcessingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryProcessingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryProcessingCount = (float?) content.GetValueForProperty("SummaryProcessingCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryProcessingCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryWarningCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryWarningCount = (float?) content.GetValueForProperty("SummaryWarningCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryWarningCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryWarningCount = (float?) content.GetValueForProperty("SummaryWarningCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryWarningCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } if (content.Contains("SummaryNoBenefitCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryNoBenefitCount = (float?) content.GetValueForProperty("SummaryNoBenefitCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal)this).SummaryNoBenefitCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryNoBenefitCount = (float?) content.GetValueForProperty("SummaryNoBenefitCount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal)this).SummaryNoBenefitCount, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.TypeConverter.cs index 1d9e4a7bebc8..15f5c2f62598 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.cs similarity index 66% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.cs index 0b7f527e6be3..9fd43cefe0e3 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -11,45 +11,45 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// The list of reservations and summary of roll out count of reservations in each state. /// public partial class ReservationsListResult : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Summary - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.Summary { get => (this._summary = this._summary ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSummary()); set { {_summary = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.Summary { get => (this._summary = this._summary ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSummary()); set { {_summary = value;} } } /// Internal Acessors for SummaryCancelledCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.SummaryCancelledCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).CancelledCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).CancelledCount = value; } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.SummaryCancelledCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).CancelledCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).CancelledCount = value; } /// Internal Acessors for SummaryExpiredCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.SummaryExpiredCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).ExpiredCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).ExpiredCount = value; } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.SummaryExpiredCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).ExpiredCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).ExpiredCount = value; } /// Internal Acessors for SummaryExpiringCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.SummaryExpiringCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).ExpiringCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).ExpiringCount = value; } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.SummaryExpiringCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).ExpiringCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).ExpiringCount = value; } /// Internal Acessors for SummaryFailedCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.SummaryFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).FailedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).FailedCount = value; } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.SummaryFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).FailedCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).FailedCount = value; } /// Internal Acessors for SummaryNoBenefitCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.SummaryNoBenefitCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).NoBenefitCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).NoBenefitCount = value; } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.SummaryNoBenefitCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).NoBenefitCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).NoBenefitCount = value; } /// Internal Acessors for SummaryPendingCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.SummaryPendingCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).PendingCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).PendingCount = value; } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.SummaryPendingCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).PendingCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).PendingCount = value; } /// Internal Acessors for SummaryProcessingCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.SummaryProcessingCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).ProcessingCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).ProcessingCount = value; } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.SummaryProcessingCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).ProcessingCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).ProcessingCount = value; } /// Internal Acessors for SummarySucceededCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.SummarySucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).SucceededCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).SucceededCount = value; } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.SummarySucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).SucceededCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).SucceededCount = value; } /// Internal Acessors for SummaryWarningCount - float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.SummaryWarningCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).WarningCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).WarningCount = value; } + float? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.SummaryWarningCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).WarningCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).WarningCount = value; } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResultInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResultInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -59,54 +59,54 @@ public partial class ReservationsListResult : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary _summary; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary _summary; /// The roll out count summary of the reservations [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary Summary { get => (this._summary = this._summary ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSummary()); set => this._summary = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary Summary { get => (this._summary = this._summary ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSummary()); set => this._summary = value; } /// The number of reservation in Cancelled state [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? SummaryCancelledCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).CancelledCount; } + public float? SummaryCancelledCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).CancelledCount; } /// The number of reservation in Expired state [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? SummaryExpiredCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).ExpiredCount; } + public float? SummaryExpiredCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).ExpiredCount; } /// The number of reservation in Expiring state [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? SummaryExpiringCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).ExpiringCount; } + public float? SummaryExpiringCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).ExpiringCount; } /// The number of reservation in Failed state [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? SummaryFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).FailedCount; } + public float? SummaryFailedCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).FailedCount; } /// The number of reservation in NoBenefit state [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? SummaryNoBenefitCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).NoBenefitCount; } + public float? SummaryNoBenefitCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).NoBenefitCount; } /// The number of reservation in Pending state [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? SummaryPendingCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).PendingCount; } + public float? SummaryPendingCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).PendingCount; } /// The number of reservation in Processing state [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? SummaryProcessingCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).ProcessingCount; } + public float? SummaryProcessingCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).ProcessingCount; } /// The number of reservation in Succeeded state [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? SummarySucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).SucceededCount; } + public float? SummarySucceededCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).SucceededCount; } /// The number of reservation in Warning state [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public float? SummaryWarningCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummaryInternal)Summary).WarningCount; } + public float? SummaryWarningCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummaryInternal)Summary).WarningCount; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] _value; + private System.Collections.Generic.List _value; /// The list of reservations. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ReservationsListResult() @@ -122,6 +122,9 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The link (url) to the next page of results.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -130,6 +133,9 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Cancelled state", SerializedName = @"cancelledCount", PossibleTypes = new [] { typeof(float) })] @@ -138,6 +144,9 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Expired state", SerializedName = @"expiredCount", PossibleTypes = new [] { typeof(float) })] @@ -146,6 +155,9 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Expiring state", SerializedName = @"expiringCount", PossibleTypes = new [] { typeof(float) })] @@ -154,6 +166,9 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Failed state", SerializedName = @"failedCount", PossibleTypes = new [] { typeof(float) })] @@ -162,6 +177,9 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in NoBenefit state", SerializedName = @"noBenefitCount", PossibleTypes = new [] { typeof(float) })] @@ -170,6 +188,9 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Pending state", SerializedName = @"pendingCount", PossibleTypes = new [] { typeof(float) })] @@ -178,6 +199,9 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Processing state", SerializedName = @"processingCount", PossibleTypes = new [] { typeof(float) })] @@ -186,6 +210,9 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Succeeded state", SerializedName = @"succeededCount", PossibleTypes = new [] { typeof(float) })] @@ -194,6 +221,9 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of reservation in Warning state", SerializedName = @"warningCount", PossibleTypes = new [] { typeof(float) })] @@ -202,10 +232,13 @@ public partial interface IReservationsListResult : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The list of reservations.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) })] + System.Collections.Generic.List Value { get; } } /// The list of reservations and summary of roll out count of reservations in each state. @@ -215,7 +248,7 @@ internal partial interface IReservationsListResultInternal /// The link (url) to the next page of results. string NextLink { get; set; } /// The roll out count summary of the reservations - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSummary Summary { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSummary Summary { get; set; } /// The number of reservation in Cancelled state float? SummaryCancelledCount { get; set; } /// The number of reservation in Expired state @@ -235,7 +268,7 @@ internal partial interface IReservationsListResultInternal /// The number of reservation in Warning state float? SummaryWarningCount { get; set; } /// The list of reservations. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.json.cs similarity index 88% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.json.cs index 97e63ac2dd5c..e7f89ead1eb4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsListResult.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ReservationsListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationsListResult(json) : null; } @@ -79,9 +79,9 @@ internal ReservationsListResult(Microsoft.Azure.PowerShell.Cmdlets.Reservations. { return; } - {_summary = If( json?.PropertyT("summary"), out var __jsonSummary) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSummary.FromJson(__jsonSummary) : Summary;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponse.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_summary = If( json?.PropertyT("summary"), out var __jsonSummary) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSummary.FromJson(__jsonSummary) : _summary;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -105,7 +105,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ return container; } AddIf( null != this._summary ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._summary.ToJson(null,serializationMode) : null, "summary" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -117,7 +117,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.PowerShell.cs new file mode 100644 index 000000000000..62ab68691688 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.PowerShell.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.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// The properties of the reservations + [System.ComponentModel.TypeConverter(typeof(ReservationsPropertiesTypeConverter))] + public partial class ReservationsProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ReservationsProperties(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.Reservations.Models.IReservationsProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ReservationsProperties(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.Reservations.Models.IReservationsProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ReservationsProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SwapProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties) content.GetValueForProperty("SwapProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSwapPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Utilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Utilization = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization) content.GetValueForProperty("Utilization",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Utilization, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesUtilizationTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).InstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScope = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("Archived")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Archived = (bool?) content.GetValueForProperty("Archived",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Archived, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Capability = (string) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Capability, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("EffectiveDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).EffectiveDateTime = (global::System.DateTime?) content.GetValueForProperty("EffectiveDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).EffectiveDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BenefitStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastUpdatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).LastUpdatedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastUpdatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).LastUpdatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SkuDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SkuDescription, global::System.Convert.ToString); + } + if (content.Contains("ExtendedStatusInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfoTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).DisplayProvisioningState = (string) content.GetValueForProperty("DisplayProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).DisplayProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningSubState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ProvisioningSubState = (string) content.GetValueForProperty("ProvisioningSubState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ProvisioningSubState, global::System.Convert.ToString); + } + if (content.Contains("PurchaseDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).PurchaseDate = (global::System.DateTime?) content.GetValueForProperty("PurchaseDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).PurchaseDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PurchaseDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).PurchaseDateTime = (global::System.DateTime?) content.GetValueForProperty("PurchaseDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).PurchaseDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SplitProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SplitProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties) content.GetValueForProperty("SplitProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SplitProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSplitPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("MergeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).MergeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties) content.GetValueForProperty("MergeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).MergeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationMergePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RenewSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewSource = (string) content.GetValueForProperty("RenewSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewSource, global::System.Convert.ToString); + } + if (content.Contains("RenewDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewDestination = (string) content.GetValueForProperty("RenewDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewDestination, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("UserFriendlyAppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UserFriendlyAppliedScopeType = (string) content.GetValueForProperty("UserFriendlyAppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UserFriendlyAppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("UserFriendlyRenewState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UserFriendlyRenewState = (string) content.GetValueForProperty("UserFriendlyRenewState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UserFriendlyRenewState, global::System.Convert.ToString); + } + if (content.Contains("RenewProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseTypeConverter.ConvertFrom); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("SwapPropertySwapSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapPropertySwapSource = (string) content.GetValueForProperty("SwapPropertySwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapPropertySwapSource, global::System.Convert.ToString); + } + if (content.Contains("SwapPropertySwapDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapPropertySwapDestination = (string) content.GetValueForProperty("SwapPropertySwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapPropertySwapDestination, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("UtilizationTrend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UtilizationTrend = (string) content.GetValueForProperty("UtilizationTrend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UtilizationTrend, global::System.Convert.ToString); + } + if (content.Contains("UtilizationAggregate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UtilizationAggregate = (System.Collections.Generic.List) content.GetValueForProperty("UtilizationAggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UtilizationAggregate, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationUtilizationAggregatesTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ReservationsProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SwapProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties) content.GetValueForProperty("SwapProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSwapPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Utilization")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Utilization = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization) content.GetValueForProperty("Utilization",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Utilization, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesUtilizationTypeConverter.ConvertFrom); + } + if (content.Contains("ReservedResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ReservedResourceType = (string) content.GetValueForProperty("ReservedResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ReservedResourceType, global::System.Convert.ToString); + } + if (content.Contains("InstanceFlexibility")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).InstanceFlexibility = (string) content.GetValueForProperty("InstanceFlexibility",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).InstanceFlexibility, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScope = (System.Collections.Generic.List) content.GetValueForProperty("AppliedScope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScope, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("Archived")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Archived = (bool?) content.GetValueForProperty("Archived",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Archived, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Capability = (string) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Capability, global::System.Convert.ToString); + } + if (content.Contains("Quantity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Quantity = (int?) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Quantity, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("EffectiveDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).EffectiveDateTime = (global::System.DateTime?) content.GetValueForProperty("EffectiveDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).EffectiveDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BenefitStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BenefitStartTime = (global::System.DateTime?) content.GetValueForProperty("BenefitStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BenefitStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastUpdatedDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).LastUpdatedDateTime = (global::System.DateTime?) content.GetValueForProperty("LastUpdatedDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).LastUpdatedDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExpiryDate = (global::System.DateTime?) content.GetValueForProperty("ExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExpiryDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExpiryDateTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExpiryDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReviewDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ReviewDateTime = (global::System.DateTime?) content.GetValueForProperty("ReviewDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ReviewDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SkuDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SkuDescription = (string) content.GetValueForProperty("SkuDescription",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SkuDescription, global::System.Convert.ToString); + } + if (content.Contains("ExtendedStatusInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExtendedStatusInfo = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo) content.GetValueForProperty("ExtendedStatusInfo",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ExtendedStatusInfo, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfoTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).DisplayProvisioningState = (string) content.GetValueForProperty("DisplayProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).DisplayProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningSubState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ProvisioningSubState = (string) content.GetValueForProperty("ProvisioningSubState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).ProvisioningSubState, global::System.Convert.ToString); + } + if (content.Contains("PurchaseDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).PurchaseDate = (global::System.DateTime?) content.GetValueForProperty("PurchaseDate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).PurchaseDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PurchaseDateTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).PurchaseDateTime = (global::System.DateTime?) content.GetValueForProperty("PurchaseDateTime",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).PurchaseDateTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SplitProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SplitProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties) content.GetValueForProperty("SplitProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SplitProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSplitPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("MergeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).MergeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties) content.GetValueForProperty("MergeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).MergeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationMergePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Renew")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Renew = (bool?) content.GetValueForProperty("Renew",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Renew, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RenewSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewSource = (string) content.GetValueForProperty("RenewSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewSource, global::System.Convert.ToString); + } + if (content.Contains("RenewDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewDestination = (string) content.GetValueForProperty("RenewDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewDestination, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("UserFriendlyAppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UserFriendlyAppliedScopeType = (string) content.GetValueForProperty("UserFriendlyAppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UserFriendlyAppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("UserFriendlyRenewState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UserFriendlyRenewState = (string) content.GetValueForProperty("UserFriendlyRenewState",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UserFriendlyRenewState, global::System.Convert.ToString); + } + if (content.Contains("RenewProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse) content.GetValueForProperty("RenewProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).RenewProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponseTypeConverter.ConvertFrom); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("SwapPropertySwapSource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapPropertySwapSource = (string) content.GetValueForProperty("SwapPropertySwapSource",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapPropertySwapSource, global::System.Convert.ToString); + } + if (content.Contains("SwapPropertySwapDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapPropertySwapDestination = (string) content.GetValueForProperty("SwapPropertySwapDestination",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).SwapPropertySwapDestination, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("UtilizationTrend")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UtilizationTrend = (string) content.GetValueForProperty("UtilizationTrend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UtilizationTrend, global::System.Convert.ToString); + } + if (content.Contains("UtilizationAggregate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UtilizationAggregate = (System.Collections.Generic.List) content.GetValueForProperty("UtilizationAggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal)this).UtilizationAggregate, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationUtilizationAggregatesTypeConverter.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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The properties of the reservations + [System.ComponentModel.TypeConverter(typeof(ReservationsPropertiesTypeConverter))] + public partial interface IReservationsProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.TypeConverter.cs index 2b82498d5238..723967bee5f0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.cs similarity index 73% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.cs index 6d79d69fd711..ebd60cfbf2c7 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.cs @@ -3,61 +3,61 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The properties of the reservations public partial class ReservationsProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal { /// Backing field for property. - private string[] _appliedScope; + private System.Collections.Generic.List _appliedScope; /// The list of applied scopes [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public string[] AppliedScope { get => this._appliedScope; set => this._appliedScope = value; } + public System.Collections.Generic.List AppliedScope { get => this._appliedScope; set => this._appliedScope = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties _appliedScopeProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties _appliedScopeProperty; /// /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties()); set => this._appliedScopeProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties()); set => this._appliedScopeProperty = value; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? _appliedScopeType; + private string _appliedScopeType; /// The applied scope type [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => this._appliedScopeType; set => this._appliedScopeType = value; } + public string AppliedScopeType { get => this._appliedScopeType; set => this._appliedScopeType = value; } /// Backing field for property. private bool? _archived; @@ -74,11 +74,11 @@ public partial class ReservationsProperties : public global::System.DateTime? BenefitStartTime { get => this._benefitStartTime; set => this._benefitStartTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? _billingPlan; + private string _billingPlan; /// The billing plan options available for this sku. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get => this._billingPlan; set => this._billingPlan = value; } + public string BillingPlan { get => this._billingPlan; set => this._billingPlan = value; } /// Backing field for property. private string _billingScopeId; @@ -130,21 +130,21 @@ public partial class ReservationsProperties : public global::System.DateTime? ExpiryDateTime { get => this._expiryDateTime; set => this._expiryDateTime = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo _extendedStatusInfo; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo _extendedStatusInfo; /// The message giving detailed information about the status code. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo ExtendedStatusInfo { get => (this._extendedStatusInfo = this._extendedStatusInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfo()); set => this._extendedStatusInfo = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo ExtendedStatusInfo { get => (this._extendedStatusInfo = this._extendedStatusInfo ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfo()); set => this._extendedStatusInfo = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? _instanceFlexibility; + private string _instanceFlexibility; /// /// Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size /// flexibility. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get => this._instanceFlexibility; set => this._instanceFlexibility = value; } + public string InstanceFlexibility { get => this._instanceFlexibility; set => this._instanceFlexibility = value; } /// Backing field for property. private global::System.DateTime? _lastUpdatedDateTime; @@ -154,45 +154,48 @@ public partial class ReservationsProperties : public global::System.DateTime? LastUpdatedDateTime { get => this._lastUpdatedDateTime; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties _mergeProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties _mergeProperty; /// Properties of reservation merge [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties MergeProperty { get => (this._mergeProperty = this._mergeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationMergeProperties()); set => this._mergeProperty = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties MergeProperty { get => (this._mergeProperty = this._mergeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationMergeProperties()); set => this._mergeProperty = value; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal.AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties()); set { {_appliedScopeProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal.AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties()); set { {_appliedScopeProperty = value;} } } /// Internal Acessors for DisplayProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal.DisplayProvisioningState { get => this._displayProvisioningState; set { {_displayProvisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal.DisplayProvisioningState { get => this._displayProvisioningState; set { {_displayProvisioningState = value;} } } /// Internal Acessors for LastUpdatedDateTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal.LastUpdatedDateTime { get => this._lastUpdatedDateTime; set { {_lastUpdatedDateTime = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal.LastUpdatedDateTime { get => this._lastUpdatedDateTime; set { {_lastUpdatedDateTime = value;} } } /// Internal Acessors for ProvisioningSubState - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal.ProvisioningSubState { get => this._provisioningSubState; set { {_provisioningSubState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal.ProvisioningSubState { get => this._provisioningSubState; set { {_provisioningSubState = value;} } } /// Internal Acessors for SwapProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal.SwapProperty { get => (this._swapProperty = this._swapProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSwapProperties()); set { {_swapProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal.SwapProperty { get => (this._swapProperty = this._swapProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSwapProperties()); set { {_swapProperty = value;} } } /// Internal Acessors for UserFriendlyAppliedScopeType - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal.UserFriendlyAppliedScopeType { get => this._userFriendlyAppliedScopeType; set { {_userFriendlyAppliedScopeType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal.UserFriendlyAppliedScopeType { get => this._userFriendlyAppliedScopeType; set { {_userFriendlyAppliedScopeType = value;} } } /// Internal Acessors for UserFriendlyRenewState - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal.UserFriendlyRenewState { get => this._userFriendlyRenewState; set { {_userFriendlyRenewState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal.UserFriendlyRenewState { get => this._userFriendlyRenewState; set { {_userFriendlyRenewState = value;} } } /// Internal Acessors for Utilization - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal.Utilization { get => (this._utilization = this._utilization ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesUtilization()); set { {_utilization = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal.Utilization { get => (this._utilization = this._utilization ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesUtilization()); set { {_utilization = value;} } } + + /// Internal Acessors for UtilizationAggregate + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal.UtilizationAggregate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)Utilization).Aggregate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)Utilization).Aggregate = value; } /// Internal Acessors for UtilizationTrend - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesInternal.UtilizationTrend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)Utilization).Trend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)Utilization).Trend = value; } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesInternal.UtilizationTrend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)Utilization).Trend; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)Utilization).Trend = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? _provisioningState; + private string _provisioningState; /// Current state of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } + public string ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } /// Backing field for property. private string _provisioningSubState; @@ -241,11 +244,11 @@ public partial class ReservationsProperties : public string RenewDestination { get => this._renewDestination; set => this._renewDestination = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse _renewProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse _renewProperty; /// The renew properties for a reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse RenewProperty { get => (this._renewProperty = this._renewProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponse()); set => this._renewProperty = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse RenewProperty { get => (this._renewProperty = this._renewProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponse()); set => this._renewProperty = value; } /// Backing field for property. private string _renewSource; @@ -257,11 +260,11 @@ public partial class ReservationsProperties : public string RenewSource { get => this._renewSource; set => this._renewSource = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? _reservedResourceType; + private string _reservedResourceType; /// The type of the resource that is being reserved. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get => this._reservedResourceType; set => this._reservedResourceType = value; } + public string ReservedResourceType { get => this._reservedResourceType; set => this._reservedResourceType = value; } /// Backing field for property. private global::System.DateTime? _reviewDateTime; @@ -278,37 +281,37 @@ public partial class ReservationsProperties : public string SkuDescription { get => this._skuDescription; set => this._skuDescription = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties _splitProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties _splitProperty; /// Properties of reservation split [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties SplitProperty { get => (this._splitProperty = this._splitProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSplitProperties()); set => this._splitProperty = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties SplitProperty { get => (this._splitProperty = this._splitProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSplitProperties()); set => this._splitProperty = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties _swapProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties _swapProperty; /// Properties of reservation swap [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties SwapProperty { get => (this._swapProperty = this._swapProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSwapProperties()); set => this._swapProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties SwapProperty { get => (this._swapProperty = this._swapProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSwapProperties()); set => this._swapProperty = value; } /// /// Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SwapPropertySwapDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)SwapProperty).SwapDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)SwapProperty).SwapDestination = value ?? null; } + public string SwapPropertySwapDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)SwapProperty).SwapDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)SwapProperty).SwapDestination = value ?? null; } /// /// Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SwapPropertySwapSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)SwapProperty).SwapSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapPropertiesInternal)SwapProperty).SwapSource = value ?? null; } + public string SwapPropertySwapSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)SwapProperty).SwapSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapPropertiesInternal)SwapProperty).SwapSource = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? _term; + private string _term; /// Represent the term of reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get => this._term; set => this._term = value; } + public string Term { get => this._term; set => this._term = value; } /// Backing field for property. private string _userFriendlyAppliedScopeType; @@ -325,19 +328,19 @@ public partial class ReservationsProperties : public string UserFriendlyRenewState { get => this._userFriendlyRenewState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization _utilization; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization _utilization; /// Reservation utilization [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization Utilization { get => (this._utilization = this._utilization ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesUtilization()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization Utilization { get => (this._utilization = this._utilization ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesUtilization()); } /// The array of aggregates of a reservation's utilization [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[] UtilizationAggregate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)Utilization).Aggregate; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)Utilization).Aggregate = value ?? null /* arrayOf */; } + public System.Collections.Generic.List UtilizationAggregate { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)Utilization).Aggregate; } /// last 7 day utilization trend for a reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string UtilizationTrend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)Utilization).Trend; } + public string UtilizationTrend { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)Utilization).Trend; } /// Creates an new instance. public ReservationsProperties() @@ -353,14 +356,20 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of applied scopes", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - string[] AppliedScope { get; set; } + System.Collections.Generic.List AppliedScope { get; set; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -371,6 +380,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -379,6 +391,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -387,6 +402,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -395,6 +413,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -403,14 +424,21 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The applied scope type", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// Indicates if the reservation is archived [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates if the reservation is archived", SerializedName = @"archived", PossibleTypes = new [] { typeof(bool) })] @@ -419,6 +447,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the DateTime when the reservation benefit started.", SerializedName = @"benefitStartTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -427,14 +458,21 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The billing plan options available for this sku.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription that will be charged for purchasing reservation or savings plan", SerializedName = @"billingScopeId", PossibleTypes = new [] { typeof(string) })] @@ -443,6 +481,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Capabilities of the reservation", SerializedName = @"capabilities", PossibleTypes = new [] { typeof(string) })] @@ -451,6 +492,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name for user to easily identify the reservation", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -459,6 +503,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the reservation for display, e.g. Succeeded", SerializedName = @"displayProvisioningState", PossibleTypes = new [] { typeof(string) })] @@ -467,6 +514,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DateTime of the reservation starting when this version is effective from.", SerializedName = @"effectiveDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -475,6 +525,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date when the reservation will expire.", SerializedName = @"expiryDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -483,6 +536,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the reservation will expire.", SerializedName = @"expiryDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -491,10 +547,13 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The message giving detailed information about the status code.", SerializedName = @"extendedStatusInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo ExtendedStatusInfo { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo ExtendedStatusInfo { get; set; } /// /// Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size /// flexibility. @@ -502,14 +561,21 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size flexibility.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } /// DateTime of the last time the reservation was updated. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DateTime of the last time the reservation was updated.", SerializedName = @"lastUpdatedDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -518,22 +584,32 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Properties of reservation merge", SerializedName = @"mergeProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties MergeProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties MergeProperty { get; set; } /// Current state of the reservation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Current state of the reservation.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", "Merged")] + string ProvisioningState { get; set; } /// The provisioning sub-state of the reservation, e.g. Succeeded [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning sub-state of the reservation, e.g. Succeeded", SerializedName = @"provisioningSubState", PossibleTypes = new [] { typeof(string) })] @@ -542,6 +618,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date when the reservation was purchased.", SerializedName = @"purchaseDate", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -550,6 +629,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the reservation was purchased.", SerializedName = @"purchaseDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -558,6 +640,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Quantity of the skus that are part of the reservation.", SerializedName = @"quantity", PossibleTypes = new [] { typeof(int) })] @@ -568,6 +653,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Setting this to true will automatically purchase a new reservation on the expiration date time.", SerializedName = @"renew", PossibleTypes = new [] { typeof(bool) })] @@ -578,6 +666,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reservation Id of the reservation which is purchased because of renew. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.", SerializedName = @"renewDestination", PossibleTypes = new [] { typeof(string) })] @@ -586,16 +677,22 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The renew properties for a reservation.", SerializedName = @"renewProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse RenewProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse RenewProperty { get; set; } /// /// Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}.", SerializedName = @"renewSource", PossibleTypes = new [] { typeof(string) })] @@ -604,14 +701,21 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of the resource that is being reserved.", SerializedName = @"reservedResourceType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"This is the date-time when the Azure Hybrid Benefit needs to be reviewed.", SerializedName = @"reviewDateTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -620,6 +724,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Description of the sku in english.", SerializedName = @"skuDescription", PossibleTypes = new [] { typeof(string) })] @@ -628,16 +735,22 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Properties of reservation split", SerializedName = @"splitProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties SplitProperty { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties SplitProperty { get; set; } /// /// Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"swapDestination", PossibleTypes = new [] { typeof(string) })] @@ -648,6 +761,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource id of the source reservation that gets swapped. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"swapSource", PossibleTypes = new [] { typeof(string) })] @@ -656,14 +772,21 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } /// The applied scope type of the reservation for display, e.g. Shared [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The applied scope type of the reservation for display, e.g. Shared", SerializedName = @"userFriendlyAppliedScopeType", PossibleTypes = new [] { typeof(string) })] @@ -672,6 +795,9 @@ public partial interface IReservationsProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The renew state of the reservation for display, e.g. On", SerializedName = @"userFriendlyRenewState", PossibleTypes = new [] { typeof(string) })] @@ -679,15 +805,21 @@ public partial interface IReservationsProperties : /// The array of aggregates of a reservation's utilization [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The array of aggregates of a reservation's utilization", SerializedName = @"aggregates", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[] UtilizationAggregate { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates) })] + System.Collections.Generic.List UtilizationAggregate { get; } /// last 7 day utilization trend for a reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"last 7 day utilization trend for a reservation", SerializedName = @"trend", PossibleTypes = new [] { typeof(string) })] @@ -699,12 +831,12 @@ internal partial interface IReservationsPropertiesInternal { /// The list of applied scopes - string[] AppliedScope { get; set; } + System.Collections.Generic.List AppliedScope { get; set; } /// /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -718,13 +850,15 @@ internal partial interface IReservationsPropertiesInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// The applied scope type - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// Indicates if the reservation is archived bool? Archived { get; set; } /// This is the DateTime when the reservation benefit started. global::System.DateTime? BenefitStartTime { get; set; } /// The billing plan options available for this sku. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan string BillingScopeId { get; set; } /// Capabilities of the reservation @@ -740,18 +874,20 @@ internal partial interface IReservationsPropertiesInternal /// This is the date-time when the reservation will expire. global::System.DateTime? ExpiryDateTime { get; set; } /// The message giving detailed information about the status code. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExtendedStatusInfo ExtendedStatusInfo { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExtendedStatusInfo ExtendedStatusInfo { get; set; } /// /// Allows reservation discount to be applied across skus within the same auto fit group. Not all skus support instance size /// flexibility. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility? InstanceFlexibility { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + string InstanceFlexibility { get; set; } /// DateTime of the last time the reservation was updated. global::System.DateTime? LastUpdatedDateTime { get; set; } /// Properties of reservation merge - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationMergeProperties MergeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationMergeProperties MergeProperty { get; set; } /// Current state of the reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Creating", "PendingResourceHold", "ConfirmedResourceHold", "PendingBilling", "ConfirmedBilling", "Created", "Succeeded", "Cancelled", "Expired", "BillingFailed", "Failed", "Split", "Merged")] + string ProvisioningState { get; set; } /// The provisioning sub-state of the reservation, e.g. Succeeded string ProvisioningSubState { get; set; } /// This is the date when the reservation was purchased. @@ -769,21 +905,22 @@ internal partial interface IReservationsPropertiesInternal /// string RenewDestination { get; set; } /// The renew properties for a reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRenewPropertiesResponse RenewProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRenewPropertiesResponse RenewProperty { get; set; } /// /// Reservation Id of the reservation from which this reservation is renewed. Format of the resource Id is /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. /// string RenewSource { get; set; } /// The type of the resource that is being reserved. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType? ReservedResourceType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + string ReservedResourceType { get; set; } /// This is the date-time when the Azure Hybrid Benefit needs to be reviewed. global::System.DateTime? ReviewDateTime { get; set; } /// Description of the sku in english. string SkuDescription { get; set; } /// Properties of reservation split - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSplitProperties SplitProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSplitProperties SplitProperty { get; set; } /// Properties of reservation swap - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationSwapProperties SwapProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationSwapProperties SwapProperty { get; set; } /// /// Reservation resource id that the original resource gets swapped to. Format of the resource id is /providers/microsoft.capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// @@ -793,15 +930,16 @@ internal partial interface IReservationsPropertiesInternal /// string SwapPropertySwapSource { get; set; } /// Represent the term of reservation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + string Term { get; set; } /// The applied scope type of the reservation for display, e.g. Shared string UserFriendlyAppliedScopeType { get; set; } /// The renew state of the reservation for display, e.g. On string UserFriendlyRenewState { get; set; } /// Reservation utilization - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization Utilization { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization Utilization { get; set; } /// The array of aggregates of a reservation's utilization - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[] UtilizationAggregate { get; set; } + System.Collections.Generic.List UtilizationAggregate { get; set; } /// last 7 day utilization trend for a reservation string UtilizationTrend { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.json.cs similarity index 88% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.json.cs index fb4b2d7a4b90..ccf1b9d1c9f0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationsProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationsProperties(json) : null; } @@ -77,41 +77,41 @@ internal ReservationsProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservations. { return; } - {_swapProperty = If( json?.PropertyT("swapProperties"), out var __jsonSwapProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSwapProperties.FromJson(__jsonSwapProperties) : SwapProperty;} - {_appliedScopeProperty = If( json?.PropertyT("appliedScopeProperties"), out var __jsonAppliedScopeProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties.FromJson(__jsonAppliedScopeProperties) : AppliedScopeProperty;} - {_utilization = If( json?.PropertyT("utilization"), out var __jsonUtilization) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsPropertiesUtilization.FromJson(__jsonUtilization) : Utilization;} - {_reservedResourceType = If( json?.PropertyT("reservedResourceType"), out var __jsonReservedResourceType) ? (string)__jsonReservedResourceType : (string)ReservedResourceType;} - {_instanceFlexibility = If( json?.PropertyT("instanceFlexibility"), out var __jsonInstanceFlexibility) ? (string)__jsonInstanceFlexibility : (string)InstanceFlexibility;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_appliedScope = If( json?.PropertyT("appliedScopes"), out var __jsonAppliedScopes) ? If( __jsonAppliedScopes as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AppliedScope;} - {_appliedScopeType = If( json?.PropertyT("appliedScopeType"), out var __jsonAppliedScopeType) ? (string)__jsonAppliedScopeType : (string)AppliedScopeType;} - {_archived = If( json?.PropertyT("archived"), out var __jsonArchived) ? (bool?)__jsonArchived : Archived;} - {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? (string)__jsonCapabilities : (string)Capability;} - {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : Quantity;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_effectiveDateTime = If( json?.PropertyT("effectiveDateTime"), out var __jsonEffectiveDateTime) ? global::System.DateTime.TryParse((string)__jsonEffectiveDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEffectiveDateTimeValue) ? __jsonEffectiveDateTimeValue : EffectiveDateTime : EffectiveDateTime;} - {_benefitStartTime = If( json?.PropertyT("benefitStartTime"), out var __jsonBenefitStartTime) ? global::System.DateTime.TryParse((string)__jsonBenefitStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBenefitStartTimeValue) ? __jsonBenefitStartTimeValue : BenefitStartTime : BenefitStartTime;} - {_lastUpdatedDateTime = If( json?.PropertyT("lastUpdatedDateTime"), out var __jsonLastUpdatedDateTime) ? global::System.DateTime.TryParse((string)__jsonLastUpdatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastUpdatedDateTimeValue) ? __jsonLastUpdatedDateTimeValue : LastUpdatedDateTime : LastUpdatedDateTime;} - {_expiryDate = If( json?.PropertyT("expiryDate"), out var __jsonExpiryDate) ? global::System.DateTime.TryParse((string)__jsonExpiryDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryDateValue) ? __jsonExpiryDateValue : ExpiryDate : ExpiryDate;} - {_expiryDateTime = If( json?.PropertyT("expiryDateTime"), out var __jsonExpiryDateTime) ? global::System.DateTime.TryParse((string)__jsonExpiryDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryDateTimeValue) ? __jsonExpiryDateTimeValue : ExpiryDateTime : ExpiryDateTime;} - {_reviewDateTime = If( json?.PropertyT("reviewDateTime"), out var __jsonReviewDateTime) ? global::System.DateTime.TryParse((string)__jsonReviewDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReviewDateTimeValue) ? __jsonReviewDateTimeValue : ReviewDateTime : ReviewDateTime;} - {_skuDescription = If( json?.PropertyT("skuDescription"), out var __jsonSkuDescription) ? (string)__jsonSkuDescription : (string)SkuDescription;} - {_extendedStatusInfo = If( json?.PropertyT("extendedStatusInfo"), out var __jsonExtendedStatusInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExtendedStatusInfo.FromJson(__jsonExtendedStatusInfo) : ExtendedStatusInfo;} - {_billingPlan = If( json?.PropertyT("billingPlan"), out var __jsonBillingPlan) ? (string)__jsonBillingPlan : (string)BillingPlan;} - {_displayProvisioningState = If( json?.PropertyT("displayProvisioningState"), out var __jsonDisplayProvisioningState) ? (string)__jsonDisplayProvisioningState : (string)DisplayProvisioningState;} - {_provisioningSubState = If( json?.PropertyT("provisioningSubState"), out var __jsonProvisioningSubState) ? (string)__jsonProvisioningSubState : (string)ProvisioningSubState;} - {_purchaseDate = If( json?.PropertyT("purchaseDate"), out var __jsonPurchaseDate) ? global::System.DateTime.TryParse((string)__jsonPurchaseDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPurchaseDateValue) ? __jsonPurchaseDateValue : PurchaseDate : PurchaseDate;} - {_purchaseDateTime = If( json?.PropertyT("purchaseDateTime"), out var __jsonPurchaseDateTime) ? global::System.DateTime.TryParse((string)__jsonPurchaseDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPurchaseDateTimeValue) ? __jsonPurchaseDateTimeValue : PurchaseDateTime : PurchaseDateTime;} - {_splitProperty = If( json?.PropertyT("splitProperties"), out var __jsonSplitProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationSplitProperties.FromJson(__jsonSplitProperties) : SplitProperty;} - {_mergeProperty = If( json?.PropertyT("mergeProperties"), out var __jsonMergeProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationMergeProperties.FromJson(__jsonMergeProperties) : MergeProperty;} - {_billingScopeId = If( json?.PropertyT("billingScopeId"), out var __jsonBillingScopeId) ? (string)__jsonBillingScopeId : (string)BillingScopeId;} - {_renew = If( json?.PropertyT("renew"), out var __jsonRenew) ? (bool?)__jsonRenew : Renew;} - {_renewSource = If( json?.PropertyT("renewSource"), out var __jsonRenewSource) ? (string)__jsonRenewSource : (string)RenewSource;} - {_renewDestination = If( json?.PropertyT("renewDestination"), out var __jsonRenewDestination) ? (string)__jsonRenewDestination : (string)RenewDestination;} - {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)Term;} - {_userFriendlyAppliedScopeType = If( json?.PropertyT("userFriendlyAppliedScopeType"), out var __jsonUserFriendlyAppliedScopeType) ? (string)__jsonUserFriendlyAppliedScopeType : (string)UserFriendlyAppliedScopeType;} - {_userFriendlyRenewState = If( json?.PropertyT("userFriendlyRenewState"), out var __jsonUserFriendlyRenewState) ? (string)__jsonUserFriendlyRenewState : (string)UserFriendlyRenewState;} - {_renewProperty = If( json?.PropertyT("renewProperties"), out var __jsonRenewProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RenewPropertiesResponse.FromJson(__jsonRenewProperties) : RenewProperty;} + {_swapProperty = If( json?.PropertyT("swapProperties"), out var __jsonSwapProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSwapProperties.FromJson(__jsonSwapProperties) : _swapProperty;} + {_appliedScopeProperty = If( json?.PropertyT("appliedScopeProperties"), out var __jsonAppliedScopeProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties.FromJson(__jsonAppliedScopeProperties) : _appliedScopeProperty;} + {_utilization = If( json?.PropertyT("utilization"), out var __jsonUtilization) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsPropertiesUtilization.FromJson(__jsonUtilization) : _utilization;} + {_reservedResourceType = If( json?.PropertyT("reservedResourceType"), out var __jsonReservedResourceType) ? (string)__jsonReservedResourceType : (string)_reservedResourceType;} + {_instanceFlexibility = If( json?.PropertyT("instanceFlexibility"), out var __jsonInstanceFlexibility) ? (string)__jsonInstanceFlexibility : (string)_instanceFlexibility;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_appliedScope = If( json?.PropertyT("appliedScopes"), out var __jsonAppliedScopes) ? If( __jsonAppliedScopes as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _appliedScope;} + {_appliedScopeType = If( json?.PropertyT("appliedScopeType"), out var __jsonAppliedScopeType) ? (string)__jsonAppliedScopeType : (string)_appliedScopeType;} + {_archived = If( json?.PropertyT("archived"), out var __jsonArchived) ? (bool?)__jsonArchived : _archived;} + {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? (string)__jsonCapabilities : (string)_capability;} + {_quantity = If( json?.PropertyT("quantity"), out var __jsonQuantity) ? (int?)__jsonQuantity : _quantity;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_effectiveDateTime = If( json?.PropertyT("effectiveDateTime"), out var __jsonEffectiveDateTime) ? global::System.DateTime.TryParse((string)__jsonEffectiveDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEffectiveDateTimeValue) ? __jsonEffectiveDateTimeValue : _effectiveDateTime : _effectiveDateTime;} + {_benefitStartTime = If( json?.PropertyT("benefitStartTime"), out var __jsonBenefitStartTime) ? global::System.DateTime.TryParse((string)__jsonBenefitStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonBenefitStartTimeValue) ? __jsonBenefitStartTimeValue : _benefitStartTime : _benefitStartTime;} + {_lastUpdatedDateTime = If( json?.PropertyT("lastUpdatedDateTime"), out var __jsonLastUpdatedDateTime) ? global::System.DateTime.TryParse((string)__jsonLastUpdatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastUpdatedDateTimeValue) ? __jsonLastUpdatedDateTimeValue : _lastUpdatedDateTime : _lastUpdatedDateTime;} + {_expiryDate = If( json?.PropertyT("expiryDate"), out var __jsonExpiryDate) ? global::System.DateTime.TryParse((string)__jsonExpiryDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryDateValue) ? __jsonExpiryDateValue : _expiryDate : _expiryDate;} + {_expiryDateTime = If( json?.PropertyT("expiryDateTime"), out var __jsonExpiryDateTime) ? global::System.DateTime.TryParse((string)__jsonExpiryDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryDateTimeValue) ? __jsonExpiryDateTimeValue : _expiryDateTime : _expiryDateTime;} + {_reviewDateTime = If( json?.PropertyT("reviewDateTime"), out var __jsonReviewDateTime) ? global::System.DateTime.TryParse((string)__jsonReviewDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonReviewDateTimeValue) ? __jsonReviewDateTimeValue : _reviewDateTime : _reviewDateTime;} + {_skuDescription = If( json?.PropertyT("skuDescription"), out var __jsonSkuDescription) ? (string)__jsonSkuDescription : (string)_skuDescription;} + {_extendedStatusInfo = If( json?.PropertyT("extendedStatusInfo"), out var __jsonExtendedStatusInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExtendedStatusInfo.FromJson(__jsonExtendedStatusInfo) : _extendedStatusInfo;} + {_billingPlan = If( json?.PropertyT("billingPlan"), out var __jsonBillingPlan) ? (string)__jsonBillingPlan : (string)_billingPlan;} + {_displayProvisioningState = If( json?.PropertyT("displayProvisioningState"), out var __jsonDisplayProvisioningState) ? (string)__jsonDisplayProvisioningState : (string)_displayProvisioningState;} + {_provisioningSubState = If( json?.PropertyT("provisioningSubState"), out var __jsonProvisioningSubState) ? (string)__jsonProvisioningSubState : (string)_provisioningSubState;} + {_purchaseDate = If( json?.PropertyT("purchaseDate"), out var __jsonPurchaseDate) ? global::System.DateTime.TryParse((string)__jsonPurchaseDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPurchaseDateValue) ? __jsonPurchaseDateValue : _purchaseDate : _purchaseDate;} + {_purchaseDateTime = If( json?.PropertyT("purchaseDateTime"), out var __jsonPurchaseDateTime) ? global::System.DateTime.TryParse((string)__jsonPurchaseDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonPurchaseDateTimeValue) ? __jsonPurchaseDateTimeValue : _purchaseDateTime : _purchaseDateTime;} + {_splitProperty = If( json?.PropertyT("splitProperties"), out var __jsonSplitProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationSplitProperties.FromJson(__jsonSplitProperties) : _splitProperty;} + {_mergeProperty = If( json?.PropertyT("mergeProperties"), out var __jsonMergeProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationMergeProperties.FromJson(__jsonMergeProperties) : _mergeProperty;} + {_billingScopeId = If( json?.PropertyT("billingScopeId"), out var __jsonBillingScopeId) ? (string)__jsonBillingScopeId : (string)_billingScopeId;} + {_renew = If( json?.PropertyT("renew"), out var __jsonRenew) ? (bool?)__jsonRenew : _renew;} + {_renewSource = If( json?.PropertyT("renewSource"), out var __jsonRenewSource) ? (string)__jsonRenewSource : (string)_renewSource;} + {_renewDestination = If( json?.PropertyT("renewDestination"), out var __jsonRenewDestination) ? (string)__jsonRenewDestination : (string)_renewDestination;} + {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)_term;} + {_userFriendlyAppliedScopeType = If( json?.PropertyT("userFriendlyAppliedScopeType"), out var __jsonUserFriendlyAppliedScopeType) ? (string)__jsonUserFriendlyAppliedScopeType : (string)_userFriendlyAppliedScopeType;} + {_userFriendlyRenewState = If( json?.PropertyT("userFriendlyRenewState"), out var __jsonUserFriendlyRenewState) ? (string)__jsonUserFriendlyRenewState : (string)_userFriendlyRenewState;} + {_renewProperty = If( json?.PropertyT("renewProperties"), out var __jsonRenewProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RenewPropertiesResponse.FromJson(__jsonRenewProperties) : _renewProperty;} AfterFromJson(json); } @@ -136,7 +136,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ } AddIf( null != this._swapProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._swapProperty.ToJson(null,serializationMode) : null, "swapProperties" ,container.Add ); AddIf( null != this._appliedScopeProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._appliedScopeProperty.ToJson(null,serializationMode) : null, "appliedScopeProperties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._utilization ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._utilization.ToJson(null,serializationMode) : null, "utilization" ,container.Add ); } @@ -159,7 +159,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); AddIf( null != this._effectiveDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._effectiveDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "effectiveDateTime" ,container.Add ); AddIf( null != this._benefitStartTime ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._benefitStartTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "benefitStartTime" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastUpdatedDateTime ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._lastUpdatedDateTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastUpdatedDateTime" ,container.Add ); } @@ -169,11 +169,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ AddIf( null != (((object)this._skuDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._skuDescription.ToString()) : null, "skuDescription" ,container.Add ); AddIf( null != this._extendedStatusInfo ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._extendedStatusInfo.ToJson(null,serializationMode) : null, "extendedStatusInfo" ,container.Add ); AddIf( null != (((object)this._billingPlan)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._billingPlan.ToString()) : null, "billingPlan" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._displayProvisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._displayProvisioningState.ToString()) : null, "displayProvisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningSubState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._provisioningSubState.ToString()) : null, "provisioningSubState" ,container.Add ); } @@ -186,11 +186,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ AddIf( null != (((object)this._renewSource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._renewSource.ToString()) : null, "renewSource" ,container.Add ); AddIf( null != (((object)this._renewDestination)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._renewDestination.ToString()) : null, "renewDestination" ,container.Add ); AddIf( null != (((object)this._term)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._term.ToString()) : null, "term" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._userFriendlyAppliedScopeType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._userFriendlyAppliedScopeType.ToString()) : null, "userFriendlyAppliedScopeType" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._userFriendlyRenewState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._userFriendlyRenewState.ToString()) : null, "userFriendlyRenewState" ,container.Add ); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.PowerShell.cs similarity index 74% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.PowerShell.cs index 6912e6cb52d5..d8b37b859409 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ReservationsPropertiesUtilization partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReservationsPropertiesUtilization(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReservationsPropertiesUtilization(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -115,17 +113,17 @@ internal ReservationsPropertiesUtilization(global::System.Collections.IDictionar // actually deserialize if (content.Contains("Trend")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)this).Trend = (string) content.GetValueForProperty("Trend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)this).Trend, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)this).Trend = (string) content.GetValueForProperty("Trend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)this).Trend, global::System.Convert.ToString); } if (content.Contains("Aggregate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)this).Aggregate = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[]) content.GetValueForProperty("Aggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)this).Aggregate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationUtilizationAggregatesTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)this).Aggregate = (System.Collections.Generic.List) content.GetValueForProperty("Aggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)this).Aggregate, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationUtilizationAggregatesTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -140,11 +138,11 @@ internal ReservationsPropertiesUtilization(global::System.Management.Automation. // actually deserialize if (content.Contains("Trend")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)this).Trend = (string) content.GetValueForProperty("Trend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)this).Trend, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)this).Trend = (string) content.GetValueForProperty("Trend",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)this).Trend, global::System.Convert.ToString); } if (content.Contains("Aggregate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)this).Aggregate = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[]) content.GetValueForProperty("Aggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal)this).Aggregate, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationUtilizationAggregatesTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)this).Aggregate = (System.Collections.Generic.List) content.GetValueForProperty("Aggregate",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal)this).Aggregate, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationUtilizationAggregatesTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.TypeConverter.cs index ed7cd8527f1a..a8e096b4855d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.cs similarity index 70% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.cs index 386195c32cdd..a26497a39061 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.cs @@ -3,25 +3,25 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Reservation utilization public partial class ReservationsPropertiesUtilization : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[] _aggregate; + private System.Collections.Generic.List _aggregate; /// The array of aggregates of a reservation's utilization [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[] Aggregate { get => this._aggregate; set => this._aggregate = value; } + public System.Collections.Generic.List Aggregate { get => this._aggregate; set => this._aggregate = value; } /// Internal Acessors for Trend - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilizationInternal.Trend { get => this._trend; set { {_trend = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilizationInternal.Trend { get => this._trend; set { {_trend = value;} } } /// Backing field for property. private string _trend; @@ -44,14 +44,20 @@ public partial interface IReservationsPropertiesUtilization : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The array of aggregates of a reservation's utilization", SerializedName = @"aggregates", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[] Aggregate { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates) })] + System.Collections.Generic.List Aggregate { get; set; } /// last 7 day utilization trend for a reservation [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"last 7 day utilization trend for a reservation", SerializedName = @"trend", PossibleTypes = new [] { typeof(string) })] @@ -63,7 +69,7 @@ internal partial interface IReservationsPropertiesUtilizationInternal { /// The array of aggregates of a reservation's utilization - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationUtilizationAggregates[] Aggregate { get; set; } + System.Collections.Generic.List Aggregate { get; set; } /// last 7 day utilization trend for a reservation string Trend { get; set; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.json.cs similarity index 88% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.json.cs index a0cec5a183d8..bd8c2036af28 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ReservationsPropertiesUtilization.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ReservationsPropertiesUtilization.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReservationsPropertiesUtilization partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsPropertiesUtilization FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsPropertiesUtilization FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ReservationsPropertiesUtilization(json) : null; } @@ -77,8 +77,8 @@ internal ReservationsPropertiesUtilization(Microsoft.Azure.PowerShell.Cmdlets.Re { return; } - {_trend = If( json?.PropertyT("trend"), out var __jsonTrend) ? (string)__jsonTrend : (string)Trend;} - {_aggregate = If( json?.PropertyT("aggregates"), out var __jsonAggregates) ? If( __jsonAggregates as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IReservationUtilizationAggregates) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationUtilizationAggregates.FromJson(__u) )) ))() : null : Aggregate;} + {_trend = If( json?.PropertyT("trend"), out var __jsonTrend) ? (string)__jsonTrend : (string)_trend;} + {_aggregate = If( json?.PropertyT("aggregates"), out var __jsonAggregates) ? If( __jsonAggregates as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationUtilizationAggregates) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationUtilizationAggregates.FromJson(__u) )) ))() : null : _aggregate;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._trend)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._trend.ToString()) : null, "trend" ,container.Add ); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 60% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.PowerShell.cs index ae09e7432c8c..e5d5d7f371a5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class Resource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Resource(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IReso /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,49 +113,49 @@ internal Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -170,43 +170,43 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("SystemData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemDataTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemDataTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataCreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("SystemDataCreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); } if (content.Contains("SystemDataLastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.TypeConverter.cs index 12f4b7ca0c99..899629ac55dc 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.cs similarity index 62% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.cs index a7c38b0d573e..dc3d2c55932a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40 /// Common fields that are returned in the response for all Azure Resource Manager resources /// public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal { /// Backing field for property. @@ -25,16 +25,34 @@ public partial class Resource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedByType = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -44,37 +62,37 @@ public partial class Resource : public string Name { get => this._name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData _systemData; /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Backing field for property. private string _type; @@ -101,6 +119,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Fully qualified resource ID for the resource. E.g. ""/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}""", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +130,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the resource", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -116,57 +140,80 @@ public partial interface IResource : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -186,19 +233,21 @@ internal partial interface IResourceInternal /// /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" /// diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.json.cs similarity index 91% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.json.cs index d16de64d1c48..8183571521fb 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api40/Resource.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/Resource.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api40.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -79,10 +79,10 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.J { return; } - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_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;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -105,19 +105,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.PowerShell.cs new file mode 100644 index 000000000000..6c20002d5e63 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.PowerShell.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. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// Request body for savings plan purchase + [System.ComponentModel.TypeConverter(typeof(SavingsPlanPurchaseRequestTypeConverter))] + public partial class SavingsPlanPurchaseRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SavingsPlanPurchaseRequest(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.Reservations.Models.ISavingsPlanPurchaseRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SavingsPlanPurchaseRequest(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.Reservations.Models.ISavingsPlanPurchaseRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SavingsPlanPurchaseRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InternalSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("Properties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("Commitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CommitmentTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("CommitmentGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentGrain = (string) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentGrain, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("CommitmentCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("CommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SavingsPlanPurchaseRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InternalSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("Properties")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("Commitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CommitmentTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("CommitmentGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentGrain = (string) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentGrain, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("CommitmentCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("CommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Request body for savings plan purchase + [System.ComponentModel.TypeConverter(typeof(SavingsPlanPurchaseRequestTypeConverter))] + public partial interface ISavingsPlanPurchaseRequest + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.TypeConverter.cs index 668fd5fda968..18c3a9c49f48 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.cs similarity index 58% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.cs index 4dffc6b9eee0..39cd7f371828 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.cs @@ -3,101 +3,101 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Request body for savings plan purchase public partial class SavingsPlanPurchaseRequest : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal { /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyDisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyDisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertySubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertySubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyTenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopePropertyTenantId = value ?? null; } /// Type of the Applied Scope. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopeType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); } + public string AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopeType = value ?? null; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).BillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan)""); } + public string BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).BillingPlan = value ?? null; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).BillingScopeId = value ?? null; } + public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).BillingScopeId = value ?? null; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public double? CommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentAmount = value ?? default(double); } + public double? CommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentAmount = value ?? default(double); } /// /// The ISO 4217 3-letter currency code for the currency used by this purchase record. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string CommitmentCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentCurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentCurrencyCode = value ?? null; } + public string CommitmentCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentCurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentCurrencyCode = value ?? null; } /// Commitment grain. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentGrain = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain)""); } + public string CommitmentGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).CommitmentGrain = value ?? null; } /// Friendly name of the savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).DisplayName = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName _internalSkuName; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName _internalSkuName; /// The name of sku [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName()); set => this._internalSkuName = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName()); set => this._internalSkuName = value; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopeProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).AppliedScopeProperty = value; } /// Internal Acessors for Commitment - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal.Commitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).Commitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).Commitment = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal.Commitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).Commitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).Commitment = value; } /// Internal Acessors for InternalSkuName - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal.InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName()); set { {_internalSkuName = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal.InternalSkuName { get => (this._internalSkuName = this._internalSkuName ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName()); set { {_internalSkuName = value;} } } /// Internal Acessors for Properties - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal.Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestProperties()); set { {_properties = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal.Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestProperties()); set { {_properties = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties _properties; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties _properties; /// Properties of a savings plan purchase [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestProperties()); set => this._properties = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties Properties { get => (this._properties = this._properties ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestProperties()); set => this._properties = value; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal)InternalSkuName).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal)InternalSkuName).Name = value ?? null; } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal)InternalSkuName).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal)InternalSkuName).Name = value ?? null; } /// Represent savings plan term in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).Term = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm)""); } + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)Properties).Term = value ?? null; } /// Creates an new instance. public SavingsPlanPurchaseRequest() @@ -113,6 +113,9 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -123,6 +126,9 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -131,6 +137,9 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -139,6 +148,9 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -147,6 +159,9 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -155,24 +170,35 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1M")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription that will be charged for purchasing reservation or savings plan", SerializedName = @"billingScopeId", PossibleTypes = new [] { typeof(string) })] @@ -181,6 +207,9 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"amount", PossibleTypes = new [] { typeof(double) })] @@ -191,6 +220,9 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] @@ -199,14 +231,21 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Commitment grain.", SerializedName = @"grain", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Hourly")] + string CommitmentGrain { get; set; } /// Friendly name of the savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name of the savings plan", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -215,6 +254,9 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -223,10 +265,14 @@ public partial interface ISavingsPlanPurchaseRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent savings plan term in ISO 8601 format.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y")] + string Term { get; set; } } /// Request body for savings plan purchase @@ -237,7 +283,7 @@ internal partial interface ISavingsPlanPurchaseRequestInternal /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -251,15 +297,17 @@ internal partial interface ISavingsPlanPurchaseRequestInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// Type of the Applied Scope. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1M")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan string BillingScopeId { get; set; } /// Commitment towards the benefit. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment Commitment { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment Commitment { get; set; } double? CommitmentAmount { get; set; } /// @@ -267,17 +315,19 @@ internal partial interface ISavingsPlanPurchaseRequestInternal /// string CommitmentCurrencyCode { get; set; } /// Commitment grain. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Hourly")] + string CommitmentGrain { get; set; } /// Friendly name of the savings plan string DisplayName { get; set; } /// The name of sku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName InternalSkuName { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName InternalSkuName { get; set; } /// Properties of a savings plan purchase - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties Properties { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties Properties { get; set; } string SkuName { get; set; } /// Represent savings plan term in ISO 8601 format. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y")] + string Term { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.json.cs similarity index 93% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.json.cs index f1ed9e1d7a76..252297f50156 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SavingsPlanPurchaseRequest partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SavingsPlanPurchaseRequest(json) : null; } @@ -77,8 +77,8 @@ internal SavingsPlanPurchaseRequest(Microsoft.Azure.PowerShell.Cmdlets.Reservati { return; } - {_internalSkuName = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuName.FromJson(__jsonSku) : InternalSkuName;} - {_properties = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestProperties.FromJson(__jsonProperties) : Properties;} + {_internalSkuName = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuName.FromJson(__jsonSku) : _internalSkuName;} + {_properties = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestProperties.FromJson(__jsonProperties) : _properties;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.PowerShell.cs new file mode 100644 index 000000000000..b9a1145a34d2 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.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.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// Properties of a savings plan purchase + [System.ComponentModel.TypeConverter(typeof(SavingsPlanPurchaseRequestPropertiesTypeConverter))] + public partial class SavingsPlanPurchaseRequestProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SavingsPlanPurchaseRequestProperties(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.Reservations.Models.ISavingsPlanPurchaseRequestProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SavingsPlanPurchaseRequestProperties(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.Reservations.Models.ISavingsPlanPurchaseRequestProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SavingsPlanPurchaseRequestProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Commitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CommitmentTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("CommitmentGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentGrain = (string) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentGrain, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("CommitmentCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("CommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SavingsPlanPurchaseRequestProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Commitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CommitmentTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("CommitmentGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentGrain = (string) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentGrain, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("CommitmentCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("CommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Properties of a savings plan purchase + [System.ComponentModel.TypeConverter(typeof(SavingsPlanPurchaseRequestPropertiesTypeConverter))] + public partial interface ISavingsPlanPurchaseRequestProperties + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.TypeConverter.cs index b56fb2b12383..4501507f6d50 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.cs similarity index 67% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.cs index 514c3ec567c8..da0362ff365b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.cs @@ -3,63 +3,63 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties of a savings plan purchase public partial class SavingsPlanPurchaseRequestProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties _appliedScopeProperty; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties _appliedScopeProperty; /// /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties()); set => this._appliedScopeProperty = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties()); set => this._appliedScopeProperty = value; } /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).DisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).ResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).SubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopePropertiesInternal)AppliedScopeProperty).TenantId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? _appliedScopeType; + private string _appliedScopeType; /// Type of the Applied Scope. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => this._appliedScopeType; set => this._appliedScopeType = value; } + public string AppliedScopeType { get => this._appliedScopeType; set => this._appliedScopeType = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? _billingPlan; + private string _billingPlan; /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get => this._billingPlan; set => this._billingPlan = value; } + public string BillingPlan { get => this._billingPlan; set => this._billingPlan = value; } /// Backing field for property. private string _billingScopeId; @@ -69,24 +69,24 @@ public partial class SavingsPlanPurchaseRequestProperties : public string BillingScopeId { get => this._billingScopeId; set => this._billingScopeId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment _commitment; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment _commitment; /// Commitment towards the benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment Commitment { get => (this._commitment = this._commitment ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Commitment()); set => this._commitment = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment Commitment { get => (this._commitment = this._commitment ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Commitment()); set => this._commitment = value; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public double? CommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)Commitment).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)Commitment).Amount = value ?? default(double); } + public double? CommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)Commitment).Amount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)Commitment).Amount = value ?? default(double); } /// /// The ISO 4217 3-letter currency code for the currency used by this purchase record. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string CommitmentCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)Commitment).CurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPriceInternal)Commitment).CurrencyCode = value ?? null; } + public string CommitmentCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)Commitment).CurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPriceInternal)Commitment).CurrencyCode = value ?? null; } /// Commitment grain. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitmentInternal)Commitment).Grain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitmentInternal)Commitment).Grain = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain)""); } + public string CommitmentGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitmentInternal)Commitment).Grain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitmentInternal)Commitment).Grain = value ?? null; } /// Backing field for property. private string _displayName; @@ -96,17 +96,17 @@ public partial class SavingsPlanPurchaseRequestProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal.AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties()); set { {_appliedScopeProperty = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal.AppliedScopeProperty { get => (this._appliedScopeProperty = this._appliedScopeProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties()); set { {_appliedScopeProperty = value;} } } /// Internal Acessors for Commitment - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestPropertiesInternal.Commitment { get => (this._commitment = this._commitment ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Commitment()); set { {_commitment = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestPropertiesInternal.Commitment { get => (this._commitment = this._commitment ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Commitment()); set { {_commitment = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? _term; + private string _term; /// Represent savings plan term in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get => this._term; set => this._term = value; } + public string Term { get => this._term; set => this._term = value; } /// Creates an new instance. public SavingsPlanPurchaseRequestProperties() @@ -122,6 +122,9 @@ public partial interface ISavingsPlanPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -132,6 +135,9 @@ public partial interface ISavingsPlanPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -140,6 +146,9 @@ public partial interface ISavingsPlanPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -148,6 +157,9 @@ public partial interface ISavingsPlanPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -156,6 +168,9 @@ public partial interface ISavingsPlanPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -164,24 +179,35 @@ public partial interface ISavingsPlanPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1M")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription that will be charged for purchasing reservation or savings plan", SerializedName = @"billingScopeId", PossibleTypes = new [] { typeof(string) })] @@ -190,6 +216,9 @@ public partial interface ISavingsPlanPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"amount", PossibleTypes = new [] { typeof(double) })] @@ -200,6 +229,9 @@ public partial interface ISavingsPlanPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] @@ -208,14 +240,21 @@ public partial interface ISavingsPlanPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Commitment grain.", SerializedName = @"grain", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Hourly")] + string CommitmentGrain { get; set; } /// Friendly name of the savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name of the savings plan", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -224,10 +263,14 @@ public partial interface ISavingsPlanPurchaseRequestProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent savings plan term in ISO 8601 format.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y")] + string Term { get; set; } } /// Properties of a savings plan purchase @@ -238,7 +281,7 @@ internal partial interface ISavingsPlanPurchaseRequestPropertiesInternal /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -252,15 +295,17 @@ internal partial interface ISavingsPlanPurchaseRequestPropertiesInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// Type of the Applied Scope. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1M")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan string BillingScopeId { get; set; } /// Commitment towards the benefit. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment Commitment { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment Commitment { get; set; } double? CommitmentAmount { get; set; } /// @@ -268,11 +313,13 @@ internal partial interface ISavingsPlanPurchaseRequestPropertiesInternal /// string CommitmentCurrencyCode { get; set; } /// Commitment grain. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Hourly")] + string CommitmentGrain { get; set; } /// Friendly name of the savings plan string DisplayName { get; set; } /// Represent savings plan term in ISO 8601 format. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y")] + string Term { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.json.cs index 29916cc881c0..44cd9258ef86 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequestProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanPurchaseRequestProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SavingsPlanPurchaseRequestProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SavingsPlanPurchaseRequestProperties(json) : null; } @@ -77,13 +77,13 @@ internal SavingsPlanPurchaseRequestProperties(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_appliedScopeProperty = If( json?.PropertyT("appliedScopeProperties"), out var __jsonAppliedScopeProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopeProperties.FromJson(__jsonAppliedScopeProperties) : AppliedScopeProperty;} - {_commitment = If( json?.PropertyT("commitment"), out var __jsonCommitment) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Commitment.FromJson(__jsonCommitment) : Commitment;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_billingScopeId = If( json?.PropertyT("billingScopeId"), out var __jsonBillingScopeId) ? (string)__jsonBillingScopeId : (string)BillingScopeId;} - {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)Term;} - {_billingPlan = If( json?.PropertyT("billingPlan"), out var __jsonBillingPlan) ? (string)__jsonBillingPlan : (string)BillingPlan;} - {_appliedScopeType = If( json?.PropertyT("appliedScopeType"), out var __jsonAppliedScopeType) ? (string)__jsonAppliedScopeType : (string)AppliedScopeType;} + {_appliedScopeProperty = If( json?.PropertyT("appliedScopeProperties"), out var __jsonAppliedScopeProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopeProperties.FromJson(__jsonAppliedScopeProperties) : _appliedScopeProperty;} + {_commitment = If( json?.PropertyT("commitment"), out var __jsonCommitment) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Commitment.FromJson(__jsonCommitment) : _commitment;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_billingScopeId = If( json?.PropertyT("billingScopeId"), out var __jsonBillingScopeId) ? (string)__jsonBillingScopeId : (string)_billingScopeId;} + {_term = If( json?.PropertyT("term"), out var __jsonTerm) ? (string)__jsonTerm : (string)_term;} + {_billingPlan = If( json?.PropertyT("billingPlan"), out var __jsonBillingPlan) ? (string)__jsonBillingPlan : (string)_billingPlan;} + {_appliedScopeType = If( json?.PropertyT("appliedScopeType"), out var __jsonAppliedScopeType) ? (string)__jsonAppliedScopeType : (string)_appliedScopeType;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.PowerShell.cs similarity index 53% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.PowerShell.cs index d3c757215e4d..3e2513d726b8 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanPurchaseRequest.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.PowerShell.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; - /// Request body for savings plan purchase - [System.ComponentModel.TypeConverter(typeof(SavingsPlanPurchaseRequestTypeConverter))] - public partial class SavingsPlanPurchaseRequest + /// Savings plan purchase details + [System.ComponentModel.TypeConverter(typeof(SavingsPlanToPurchaseCalculateExchangeTypeConverter))] + public partial class SavingsPlanToPurchaseCalculateExchange { /// @@ -63,46 +63,49 @@ public partial class SavingsPlanPurchaseRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new SavingsPlanPurchaseRequest(content); + return new SavingsPlanToPurchaseCalculateExchange(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new SavingsPlanPurchaseRequest(content); + return new SavingsPlanToPurchaseCalculateExchange(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// 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.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal SavingsPlanPurchaseRequest(global::System.Collections.IDictionary content) + internal SavingsPlanToPurchaseCalculateExchange(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -111,87 +114,95 @@ internal SavingsPlanPurchaseRequest(global::System.Collections.IDictionary conte return; } // actually deserialize - if (content.Contains("InternalSkuName")) + if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom); } - if (content.Contains("Properties")) + if (content.Contains("BillingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } - if (content.Contains("SkuName")) + if (content.Contains("SavingsPlanPurchaseRequestProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).SkuName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SavingsPlanPurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("SavingsPlanPurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SavingsPlanPurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Commitment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CommitmentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CommitmentTypeConverter.ConvertFrom); } if (content.Contains("BillingPlan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SkuName, global::System.Convert.ToString); } if (content.Contains("AppliedScopeProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("BillingScopeId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).BillingScopeId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); } if (content.Contains("Term")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Term, global::System.Convert.ToString); } if (content.Contains("AppliedScopeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeType, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertySubscriptionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); } if (content.Contains("CommitmentGrain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentGrain = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain?) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentGrain, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentGrain = (string) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentGrain, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyManagementGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyResourceGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); } if (content.Contains("CommitmentCurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); } if (content.Contains("CommitmentAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal SavingsPlanPurchaseRequest(global::System.Management.Automation.PSObject content) + internal SavingsPlanToPurchaseCalculateExchange(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -200,77 +211,85 @@ internal SavingsPlanPurchaseRequest(global::System.Management.Automation.PSObjec return; } // actually deserialize - if (content.Contains("InternalSkuName")) + if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).InternalSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName) content.GetValueForProperty("InternalSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).InternalSkuName, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SkuNameTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom); } - if (content.Contains("Properties")) + if (content.Contains("BillingCurrencyTotal")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Properties = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("Properties",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Properties, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); } - if (content.Contains("SkuName")) + if (content.Contains("SavingsPlanPurchaseRequestProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).SkuName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SavingsPlanPurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("SavingsPlanPurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SavingsPlanPurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Commitment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CommitmentTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CommitmentTypeConverter.ConvertFrom); } if (content.Contains("BillingPlan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).BillingPlan = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan?) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).BillingPlan, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).SkuName, global::System.Convert.ToString); } if (content.Contains("AppliedScopeProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedScopePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("BillingScopeId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).BillingScopeId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); } if (content.Contains("Term")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Term = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm?) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).Term, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).Term, global::System.Convert.ToString); } if (content.Contains("AppliedScopeType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType?) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopeType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopeType, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyTenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertySubscriptionId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyDisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); } if (content.Contains("CommitmentGrain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentGrain = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain?) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentGrain, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentGrain = (string) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentGrain, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyManagementGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); } if (content.Contains("AppliedScopePropertyResourceGroupId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); } if (content.Contains("CommitmentCurrencyCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); } if (content.Contains("CommitmentAmount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); } AfterDeserializePSObject(content); } @@ -292,9 +311,9 @@ public override string ToString() return ToJsonString(); } } - /// Request body for savings plan purchase - [System.ComponentModel.TypeConverter(typeof(SavingsPlanPurchaseRequestTypeConverter))] - public partial interface ISavingsPlanPurchaseRequest + /// Savings plan purchase details + [System.ComponentModel.TypeConverter(typeof(SavingsPlanToPurchaseCalculateExchangeTypeConverter))] + public partial interface ISavingsPlanToPurchaseCalculateExchange { diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.TypeConverter.cs index bc5fe056f59d..270763bd8b3f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.cs similarity index 58% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.cs index 5b239cd2402c..781b1b60847a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.cs @@ -3,104 +3,104 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Savings plan purchase details public partial class SavingsPlanToPurchaseCalculateExchange : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal { /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyTenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyTenantId = value ?? null; } /// Type of the Applied Scope. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); } + public string AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyTotal; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyTotal = value; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).BillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan)""); } + public string BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).BillingPlan = value ?? null; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).BillingScopeId = value ?? null; } + public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).BillingScopeId = value ?? null; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public double? CommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentAmount = value ?? default(double); } + public double? CommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentAmount = value ?? default(double); } /// /// The ISO 4217 3-letter currency code for the currency used by this purchase record. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string CommitmentCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentCurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentCurrencyCode = value ?? null; } + public string CommitmentCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentCurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentCurrencyCode = value ?? null; } /// Commitment grain. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentGrain = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain)""); } + public string CommitmentGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentGrain = value ?? null; } /// Friendly name of the savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).DisplayName = value ?? null; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeProperty = value; } /// Internal Acessors for Commitment - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal.Commitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Commitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Commitment = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal.Commitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Commitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Commitment = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequest()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequest()); set { {_property = value;} } } /// Internal Acessors for SavingsPlanPurchaseRequestProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal.SavingsPlanPurchaseRequestProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Properties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Properties = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal.SavingsPlanPurchaseRequestProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Properties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Properties = value; } /// Internal Acessors for Sku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchangeInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).InternalSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).InternalSkuName = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchangeInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).InternalSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).InternalSkuName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest _property; /// Request body for savings plan purchase [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequest()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequest()); set => this._property = value; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).SkuName = value ?? null; } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).SkuName = value ?? null; } /// Represent savings plan term in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Term = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm)""); } + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Term = value ?? null; } /// Creates an new instance. public SavingsPlanToPurchaseCalculateExchange() @@ -116,6 +116,9 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -126,6 +129,9 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -134,6 +140,9 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -142,6 +151,9 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +162,9 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -158,32 +173,46 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get; set; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1M")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription that will be charged for purchasing reservation or savings plan", SerializedName = @"billingScopeId", PossibleTypes = new [] { typeof(string) })] @@ -192,6 +221,9 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"amount", PossibleTypes = new [] { typeof(double) })] @@ -202,6 +234,9 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] @@ -210,14 +245,21 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Commitment grain.", SerializedName = @"grain", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Hourly")] + string CommitmentGrain { get; set; } /// Friendly name of the savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name of the savings plan", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -226,6 +268,9 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -234,10 +279,14 @@ public partial interface ISavingsPlanToPurchaseCalculateExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent savings plan term in ISO 8601 format.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y")] + string Term { get; set; } } /// Savings plan purchase details @@ -248,7 +297,7 @@ internal partial interface ISavingsPlanToPurchaseCalculateExchangeInternal /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -262,17 +311,19 @@ internal partial interface ISavingsPlanToPurchaseCalculateExchangeInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// Type of the Applied Scope. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get; set; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1M")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan string BillingScopeId { get; set; } /// Commitment towards the benefit. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment Commitment { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment Commitment { get; set; } double? CommitmentAmount { get; set; } /// @@ -280,19 +331,21 @@ internal partial interface ISavingsPlanToPurchaseCalculateExchangeInternal /// string CommitmentCurrencyCode { get; set; } /// Commitment grain. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Hourly")] + string CommitmentGrain { get; set; } /// Friendly name of the savings plan string DisplayName { get; set; } /// Request body for savings plan purchase - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest Property { get; set; } /// Properties of a savings plan purchase - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties SavingsPlanPurchaseRequestProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties SavingsPlanPurchaseRequestProperty { get; set; } /// The name of sku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName Sku { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName Sku { get; set; } string SkuName { get; set; } /// Represent savings plan term in ISO 8601 format. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y")] + string Term { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.json.cs index 0207dd8827ff..23721485a7b1 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseCalculateExchange.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseCalculateExchange.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SavingsPlanToPurchaseCalculateExchange partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseCalculateExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseCalculateExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SavingsPlanToPurchaseCalculateExchange(json) : null; } @@ -77,8 +77,8 @@ internal SavingsPlanToPurchaseCalculateExchange(Microsoft.Azure.PowerShell.Cmdle { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequest.FromJson(__jsonProperties) : Property;} - {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyTotal) : BillingCurrencyTotal;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequest.FromJson(__jsonProperties) : _property;} + {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyTotal) : _billingCurrencyTotal;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.PowerShell.cs new file mode 100644 index 000000000000..9ac173a45d91 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.PowerShell.cs @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + + /// Savings plan purchase details + [System.ComponentModel.TypeConverter(typeof(SavingsPlanToPurchaseExchangeTypeConverter))] + public partial class SavingsPlanToPurchaseExchange + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchange DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SavingsPlanToPurchaseExchange(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.Reservations.Models.ISavingsPlanToPurchaseExchange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SavingsPlanToPurchaseExchange(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.Reservations.Models.ISavingsPlanToPurchaseExchange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SavingsPlanToPurchaseExchange(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.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom); + } + if (content.Contains("SavingsPlanOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanOrderId = (string) content.GetValueForProperty("SavingsPlanOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanOrderId, global::System.Convert.ToString); + } + if (content.Contains("SavingsPlanId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanId = (string) content.GetValueForProperty("SavingsPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanId, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("SavingsPlanPurchaseRequestProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanPurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("SavingsPlanPurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanPurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Commitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CommitmentTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("CommitmentGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentGrain = (string) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentGrain, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("CommitmentCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("CommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SavingsPlanToPurchaseExchange(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.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestTypeConverter.ConvertFrom); + } + if (content.Contains("SavingsPlanOrderId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanOrderId = (string) content.GetValueForProperty("SavingsPlanOrderId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanOrderId, global::System.Convert.ToString); + } + if (content.Contains("SavingsPlanId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanId = (string) content.GetValueForProperty("SavingsPlanId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanId, global::System.Convert.ToString); + } + if (content.Contains("BillingCurrencyTotal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingCurrencyTotal = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) content.GetValueForProperty("BillingCurrencyTotal",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingCurrencyTotal, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PriceTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("SavingsPlanPurchaseRequestProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanPurchaseRequestProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties) content.GetValueForProperty("SavingsPlanPurchaseRequestProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SavingsPlanPurchaseRequestProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequestPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Commitment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Commitment = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment) content.GetValueForProperty("Commitment",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Commitment, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CommitmentTypeConverter.ConvertFrom); + } + if (content.Contains("BillingPlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingPlan = (string) content.GetValueForProperty("BillingPlan",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingPlan, global::System.Convert.ToString); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SkuNameTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeProperty = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties) content.GetValueForProperty("AppliedScopeProperty",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeProperty, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("BillingScopeId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingScopeId = (string) content.GetValueForProperty("BillingScopeId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).BillingScopeId, global::System.Convert.ToString); + } + if (content.Contains("Term")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Term = (string) content.GetValueForProperty("Term",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).Term, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopeType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeType = (string) content.GetValueForProperty("AppliedScopeType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopeType, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyTenantId = (string) content.GetValueForProperty("AppliedScopePropertyTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyTenantId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertySubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertySubscriptionId = (string) content.GetValueForProperty("AppliedScopePropertySubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertySubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyDisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyDisplayName = (string) content.GetValueForProperty("AppliedScopePropertyDisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyDisplayName, global::System.Convert.ToString); + } + if (content.Contains("CommitmentGrain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentGrain = (string) content.GetValueForProperty("CommitmentGrain",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentGrain, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyManagementGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyManagementGroupId = (string) content.GetValueForProperty("AppliedScopePropertyManagementGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyManagementGroupId, global::System.Convert.ToString); + } + if (content.Contains("AppliedScopePropertyResourceGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyResourceGroupId = (string) content.GetValueForProperty("AppliedScopePropertyResourceGroupId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).AppliedScopePropertyResourceGroupId, global::System.Convert.ToString); + } + if (content.Contains("CommitmentCurrencyCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentCurrencyCode = (string) content.GetValueForProperty("CommitmentCurrencyCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentCurrencyCode, global::System.Convert.ToString); + } + if (content.Contains("CommitmentAmount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentAmount = (double?) content.GetValueForProperty("CommitmentAmount",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal)this).CommitmentAmount, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); + } + 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.Reservations.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Savings plan purchase details + [System.ComponentModel.TypeConverter(typeof(SavingsPlanToPurchaseExchangeTypeConverter))] + public partial interface ISavingsPlanToPurchaseExchange + + { + + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.TypeConverter.cs index 1ddcacb73b52..182f6d1c4d06 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchange ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchange).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.cs similarity index 61% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.cs index f9c1bd906d18..5ba4e80690e3 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.cs @@ -3,97 +3,97 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Savings plan purchase details public partial class SavingsPlanToPurchaseExchange : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchange, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal { /// Display name [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName = value ?? null; } + public string AppliedScopePropertyDisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyDisplayName = value ?? null; } /// /// Fully-qualified identifier of the management group where the benefit must be applied. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId = value ?? null; } + public string AppliedScopePropertyManagementGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyManagementGroupId = value ?? null; } /// Fully-qualified identifier of the resource group. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId = value ?? null; } + public string AppliedScopePropertyResourceGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyResourceGroupId = value ?? null; } /// Fully-qualified identifier of the subscription. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId = value ?? null; } + public string AppliedScopePropertySubscriptionId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertySubscriptionId = value ?? null; } /// Tenant ID where the savings plan should apply benefit. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyTenantId = value ?? null; } + public string AppliedScopePropertyTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopePropertyTenantId = value ?? null; } /// Type of the Applied Scope. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); } + public string AppliedScopeType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeType = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice _billingCurrencyTotal; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice _billingCurrencyTotal; /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price()); set => this._billingCurrencyTotal = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get => (this._billingCurrencyTotal = this._billingCurrencyTotal ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price()); set => this._billingCurrencyTotal = value; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).BillingPlan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan)""); } + public string BillingPlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).BillingPlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).BillingPlan = value ?? null; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).BillingScopeId = value ?? null; } + public string BillingScopeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).BillingScopeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).BillingScopeId = value ?? null; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public double? CommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentAmount = value ?? default(double); } + public double? CommitmentAmount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentAmount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentAmount = value ?? default(double); } /// /// The ISO 4217 3-letter currency code for the currency used by this purchase record. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string CommitmentCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentCurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentCurrencyCode = value ?? null; } + public string CommitmentCurrencyCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentCurrencyCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentCurrencyCode = value ?? null; } /// Commitment grain. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).CommitmentGrain = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain)""); } + public string CommitmentGrain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentGrain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).CommitmentGrain = value ?? null; } /// Friendly name of the savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).DisplayName = value ?? null; } /// Internal Acessors for AppliedScopeProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal.AppliedScopeProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).AppliedScopeProperty = value; } /// Internal Acessors for Commitment - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal.Commitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Commitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Commitment = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal.Commitment { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Commitment; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Commitment = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequest()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequest()); set { {_property = value;} } } /// Internal Acessors for SavingsPlanPurchaseRequestProperty - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal.SavingsPlanPurchaseRequestProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Properties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Properties = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal.SavingsPlanPurchaseRequestProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Properties; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Properties = value; } /// Internal Acessors for Sku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchangeInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).InternalSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).InternalSkuName = value; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchangeInternal.Sku { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).InternalSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).InternalSkuName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest _property; /// Request body for savings plan purchase [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequest()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequest()); set => this._property = value; } /// Backing field for property. private string _savingsPlanId; @@ -113,18 +113,18 @@ public partial class SavingsPlanToPurchaseExchange : public string SavingsPlanOrderId { get => this._savingsPlanOrderId; set => this._savingsPlanOrderId = value; } [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).SkuName = value ?? null; } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).SkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).SkuName = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? _status; + private string _status; /// Status of the individual operation. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? Status { get => this._status; set => this._status = value; } + public string Status { get => this._status; set => this._status = value; } /// Represent savings plan term in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestInternal)Property).Term = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm)""); } + public string Term { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Term; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestInternal)Property).Term = value ?? null; } /// Creates an new instance. public SavingsPlanToPurchaseExchange() @@ -140,6 +140,9 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +153,9 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", SerializedName = @"managementGroupId", PossibleTypes = new [] { typeof(string) })] @@ -158,6 +164,9 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the resource group.", SerializedName = @"resourceGroupId", PossibleTypes = new [] { typeof(string) })] @@ -166,6 +175,9 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully-qualified identifier of the subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -174,6 +186,9 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Tenant ID where the savings plan should apply benefit.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -182,32 +197,46 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// Pricing information containing the amount and the currency code [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Pricing information containing the amount and the currency code", SerializedName = @"billingCurrencyTotal", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice) })] + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get; set; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represents the billing plan in ISO 8601 format. Required only for monthly billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1M")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Subscription that will be charged for purchasing reservation or savings plan", SerializedName = @"billingScopeId", PossibleTypes = new [] { typeof(string) })] @@ -216,6 +245,9 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"amount", PossibleTypes = new [] { typeof(double) })] @@ -226,6 +258,9 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ISO 4217 3-letter currency code for the currency used by this purchase record.", SerializedName = @"currencyCode", PossibleTypes = new [] { typeof(string) })] @@ -234,14 +269,21 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Commitment grain.", SerializedName = @"grain", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Hourly")] + string CommitmentGrain { get; set; } /// Friendly name of the savings plan [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Friendly name of the savings plan", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -253,6 +295,9 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified id of the savings plan being purchased. This value is only guaranteed to be non-null if the purchase is successful.", SerializedName = @"savingsPlanId", PossibleTypes = new [] { typeof(string) })] @@ -261,6 +306,9 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Fully qualified id of the savings plan order being purchased", SerializedName = @"savingsPlanOrderId", PossibleTypes = new [] { typeof(string) })] @@ -269,6 +317,9 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -277,18 +328,26 @@ public partial interface ISavingsPlanToPurchaseExchange : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Status of the individual operation.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? Status { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending")] + string Status { get; set; } /// Represent savings plan term in ISO 8601 format. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Represent savings plan term in ISO 8601 format.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y")] + string Term { get; set; } } /// Savings plan purchase details @@ -299,7 +358,7 @@ internal partial interface ISavingsPlanToPurchaseExchangeInternal /// Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId /// if AppliedScopeType is ManagementGroup /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedScopeProperties AppliedScopeProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedScopeProperties AppliedScopeProperty { get; set; } /// Display name string AppliedScopePropertyDisplayName { get; set; } /// @@ -313,17 +372,19 @@ internal partial interface ISavingsPlanToPurchaseExchangeInternal /// Tenant ID where the savings plan should apply benefit. string AppliedScopePropertyTenantId { get; set; } /// Type of the Applied Scope. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType? AppliedScopeType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + string AppliedScopeType { get; set; } /// Pricing information containing the amount and the currency code - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPrice BillingCurrencyTotal { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPrice BillingCurrencyTotal { get; set; } /// /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. /// - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan? BillingPlan { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1M")] + string BillingPlan { get; set; } /// Subscription that will be charged for purchasing reservation or savings plan string BillingScopeId { get; set; } /// Commitment towards the benefit. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICommitment Commitment { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICommitment Commitment { get; set; } double? CommitmentAmount { get; set; } /// @@ -331,11 +392,12 @@ internal partial interface ISavingsPlanToPurchaseExchangeInternal /// string CommitmentCurrencyCode { get; set; } /// Commitment grain. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain? CommitmentGrain { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Hourly")] + string CommitmentGrain { get; set; } /// Friendly name of the savings plan string DisplayName { get; set; } /// Request body for savings plan purchase - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest Property { get; set; } /// /// Fully qualified id of the savings plan being purchased. This value is only guaranteed to be non-null if the purchase is /// successful. @@ -344,15 +406,17 @@ internal partial interface ISavingsPlanToPurchaseExchangeInternal /// Fully qualified id of the savings plan order being purchased string SavingsPlanOrderId { get; set; } /// Properties of a savings plan purchase - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequestProperties SavingsPlanPurchaseRequestProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequestProperties SavingsPlanPurchaseRequestProperty { get; set; } /// The name of sku - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName Sku { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName Sku { get; set; } string SkuName { get; set; } /// Status of the individual operation. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending")] + string Status { get; set; } /// Represent savings plan term in ISO 8601 format. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm? Term { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y")] + string Term { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.json.cs index 9bcaab1cf307..01295d266769 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SavingsPlanToPurchaseExchange.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SavingsPlanToPurchaseExchange.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SavingsPlanToPurchaseExchange partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchange. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchange. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanToPurchaseExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanToPurchaseExchange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SavingsPlanToPurchaseExchange(json) : null; } @@ -77,11 +77,11 @@ internal SavingsPlanToPurchaseExchange(Microsoft.Azure.PowerShell.Cmdlets.Reserv { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SavingsPlanPurchaseRequest.FromJson(__jsonProperties) : Property;} - {_savingsPlanOrderId = If( json?.PropertyT("savingsPlanOrderId"), out var __jsonSavingsPlanOrderId) ? (string)__jsonSavingsPlanOrderId : (string)SavingsPlanOrderId;} - {_savingsPlanId = If( json?.PropertyT("savingsPlanId"), out var __jsonSavingsPlanId) ? (string)__jsonSavingsPlanId : (string)SavingsPlanId;} - {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Price.FromJson(__jsonBillingCurrencyTotal) : BillingCurrencyTotal;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SavingsPlanPurchaseRequest.FromJson(__jsonProperties) : _property;} + {_savingsPlanOrderId = If( json?.PropertyT("savingsPlanOrderId"), out var __jsonSavingsPlanOrderId) ? (string)__jsonSavingsPlanOrderId : (string)_savingsPlanOrderId;} + {_savingsPlanId = If( json?.PropertyT("savingsPlanId"), out var __jsonSavingsPlanId) ? (string)__jsonSavingsPlanId : (string)_savingsPlanId;} + {_billingCurrencyTotal = If( json?.PropertyT("billingCurrencyTotal"), out var __jsonBillingCurrencyTotal) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Price.FromJson(__jsonBillingCurrencyTotal) : _billingCurrencyTotal;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.PowerShell.cs similarity index 81% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.PowerShell.cs index ddbf71f6aad0..de92f0d5723a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScopeProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScopeProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScopeProperties(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal ScopeProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopePropertiesInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopePropertiesInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("Valid")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopePropertiesInternal)this).Valid = (bool?) content.GetValueForProperty("Valid",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopePropertiesInternal)this).Valid, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopePropertiesInternal)this).Valid = (bool?) content.GetValueForProperty("Valid",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopePropertiesInternal)this).Valid, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal ScopeProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopePropertiesInternal)this).Scope, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopePropertiesInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopePropertiesInternal)this).Scope, global::System.Convert.ToString); } if (content.Contains("Valid")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopePropertiesInternal)this).Valid = (bool?) content.GetValueForProperty("Valid",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopePropertiesInternal)this).Valid, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopePropertiesInternal)this).Valid = (bool?) content.GetValueForProperty("Valid",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopePropertiesInternal)this).Valid, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.TypeConverter.cs index 22d05f208cd6..6efc238663cf 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.cs similarity index 88% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.cs index bfdca78be89a..4365f55119a3 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The scope and whether it is valid. public partial class ScopeProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopePropertiesInternal { /// Backing field for property. @@ -38,6 +38,9 @@ public partial interface IScopeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"scope", PossibleTypes = new [] { typeof(string) })] @@ -46,6 +49,9 @@ public partial interface IScopeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"valid", PossibleTypes = new [] { typeof(bool) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.json.cs index dfe45f086f0e..bdbafea161f0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/ScopeProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/ScopeProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScopeProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new ScopeProperties(json) : null; } @@ -77,8 +77,8 @@ internal ScopeProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime { return; } - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} - {_valid = If( json?.PropertyT("valid"), out var __jsonValid) ? (bool?)__jsonValid : Valid;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} + {_valid = If( json?.PropertyT("valid"), out var __jsonValid) ? (bool?)__jsonValid : _valid;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.PowerShell.cs similarity index 81% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.PowerShell.cs index 66f38a51913d..3e2632b37457 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class SkuCapability partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SkuCapability(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SkuCapability(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal SkuCapability(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapabilityInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapabilityInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapabilityInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapabilityInternal)this).Value, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal SkuCapability(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapabilityInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapabilityInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapabilityInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapabilityInternal)this).Value, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.TypeConverter.cs index a75b8117e63d..3230ca9c0ad2 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.cs index 8b868e961c1f..0125065d97ff 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Capability of a sku. public partial class SkuCapability : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapabilityInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapabilityInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface ISkuCapability : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An invariant to describe the feature.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface ISkuCapability : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An invariant if the feature is measured by quantity.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.json.cs index 0a3c31a4b27d..2f6c2b9161f1 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuCapability.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuCapability.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SkuCapability partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuCapability FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuCapability FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SkuCapability(json) : null; } @@ -77,8 +77,8 @@ internal SkuCapability(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.J { 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;} + {_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); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.PowerShell.cs similarity index 86% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.PowerShell.cs index 500ee42bb1af..2f40ad90b469 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class SkuName partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SkuName(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SkuName(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,13 +111,13 @@ internal SkuName(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal)this).Name, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,7 +132,7 @@ internal SkuName(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal)this).Name, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.TypeConverter.cs index b07abc3aa298..b4542e8debd7 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.cs similarity index 87% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.cs index eabfde22182e..83d01204a558 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The name of sku public partial class SkuName : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuNameInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuNameInternal { /// Backing field for property. @@ -32,6 +32,9 @@ public partial interface ISkuName : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.json.cs index 8252879fc304..97b7676fab90 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuName.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuName.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class SkuName partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuName FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName. + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuName FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SkuName(json) : null; } @@ -77,7 +75,7 @@ internal SkuName(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.Js { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.PowerShell.cs similarity index 82% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.PowerShell.cs index cee3d49750be..f768da4ed3ad 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class SkuProperty partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SkuProperty(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SkuProperty(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal SkuProperty(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuPropertyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuPropertyInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuPropertyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuPropertyInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuPropertyInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuPropertyInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuPropertyInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuPropertyInternal)this).Value, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal SkuProperty(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuPropertyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuPropertyInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuPropertyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuPropertyInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuPropertyInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuPropertyInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuPropertyInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuPropertyInternal)this).Value, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.TypeConverter.cs index 0be01253c7d5..16af0e478083 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.cs index aab42b12c4d0..23f0f776bf31 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Property of a sku. public partial class SkuProperty : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuPropertyInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuPropertyInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface ISkuProperty : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An invariant to describe the feature.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface ISkuProperty : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"An invariant if the feature is measured by quantity.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.json.cs index ff2b3dd2f863..52ece418dedf 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuProperty.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuProperty.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SkuProperty partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuProperty FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuProperty FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SkuProperty(json) : null; } @@ -77,8 +77,8 @@ internal SkuProperty(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Jso { 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;} + {_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); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.PowerShell.cs similarity index 77% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.PowerShell.cs index a53b80f17c3b..05b9edf49748 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class SkuRestriction partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SkuRestriction(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SkuRestriction(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,21 +111,21 @@ internal SkuRestriction(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Values")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).Values = (string[]) content.GetValueForProperty("Values",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).Values, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).Values = (System.Collections.Generic.List) content.GetValueForProperty("Values",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).Values, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ReasonCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).ReasonCode = (string) content.GetValueForProperty("ReasonCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).ReasonCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).ReasonCode = (string) content.GetValueForProperty("ReasonCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).ReasonCode, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -140,15 +140,15 @@ internal SkuRestriction(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Values")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).Values = (string[]) content.GetValueForProperty("Values",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).Values, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).Values = (System.Collections.Generic.List) content.GetValueForProperty("Values",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).Values, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ReasonCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).ReasonCode = (string) content.GetValueForProperty("ReasonCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal)this).ReasonCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).ReasonCode = (string) content.GetValueForProperty("ReasonCode",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal)this).ReasonCode, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.TypeConverter.cs index edf46e120f61..f3309de5ecde 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.cs similarity index 85% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.cs index ec6009268d82..9212fd303f05 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Restriction of a sku. public partial class SkuRestriction : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestrictionInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestrictionInternal { /// Backing field for property. @@ -30,7 +30,7 @@ public partial class SkuRestriction : public string Type { get => this._type; set => this._type = value; } /// Backing field for property. - private string[] _values; + private System.Collections.Generic.List _values; /// /// The value of restrictions. If the restriction type is set to location. This would be different locations where the sku @@ -38,7 +38,7 @@ public partial class SkuRestriction : /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.FormatTable(Index = 1)] - public string[] Values { get => this._values; set => this._values = value; } + public System.Collections.Generic.List Values { get => this._values; set => this._values = value; } /// Creates an new instance. public SkuRestriction() @@ -54,6 +54,9 @@ public partial interface ISkuRestriction : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The reason for restriction.", SerializedName = @"reasonCode", PossibleTypes = new [] { typeof(string) })] @@ -62,6 +65,9 @@ public partial interface ISkuRestriction : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of restrictions.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -73,10 +79,13 @@ public partial interface ISkuRestriction : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value of restrictions. If the restriction type is set to location. This would be different locations where the sku is restricted.", SerializedName = @"values", PossibleTypes = new [] { typeof(string) })] - string[] Values { get; set; } + System.Collections.Generic.List Values { get; set; } } /// Restriction of a sku. @@ -91,7 +100,7 @@ internal partial interface ISkuRestrictionInternal /// The value of restrictions. If the restriction type is set to location. This would be different locations where the sku /// is restricted. /// - string[] Values { get; set; } + System.Collections.Generic.List Values { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.json.cs index 739af687a5f4..693abc2a9814 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SkuRestriction.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SkuRestriction.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SkuRestriction partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISkuRestriction FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISkuRestriction FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SkuRestriction(json) : null; } @@ -77,9 +77,9 @@ internal SkuRestriction(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime. { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_values = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Values;} - {_reasonCode = If( json?.PropertyT("reasonCode"), out var __jsonReasonCode) ? (string)__jsonReasonCode : (string)ReasonCode;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_values = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _values;} + {_reasonCode = If( json?.PropertyT("reasonCode"), out var __jsonReasonCode) ? (string)__jsonReasonCode : (string)_reasonCode;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.PowerShell.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.PowerShell.cs index 827b9879093c..62ffca3f2b58 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class SplitProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SplitProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SplitProperties(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,17 +111,17 @@ internal SplitProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Quantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)this).Quantity = (int[]) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)this).Quantity, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)this).Quantity = (System.Collections.Generic.List) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)this).Quantity, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)this).ReservationId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,11 +136,11 @@ internal SplitProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Quantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)this).Quantity = (int[]) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)this).Quantity, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)this).Quantity = (System.Collections.Generic.List) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)this).Quantity, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)this).ReservationId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.TypeConverter.cs index 7d5f298b3911..b82a995f2d93 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.cs similarity index 84% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.cs index 9d3ccb505637..b2510eeeb7cf 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Properties for reservation split public partial class SplitProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal { /// Backing field for property. - private int[] _quantity; + private System.Collections.Generic.List _quantity; /// List of the quantities in the new reservations to create. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public int[] Quantity { get => this._quantity; set => this._quantity = value; } + public System.Collections.Generic.List Quantity { get => this._quantity; set => this._quantity = value; } /// Backing field for property. private string _reservationId; @@ -43,16 +43,22 @@ public partial interface ISplitProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of the quantities in the new reservations to create.", SerializedName = @"quantities", PossibleTypes = new [] { typeof(int) })] - int[] Quantity { get; set; } + System.Collections.Generic.List Quantity { get; set; } /// /// Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] @@ -64,7 +70,7 @@ internal partial interface ISplitPropertiesInternal { /// List of the quantities in the new reservations to create. - int[] Quantity { get; set; } + System.Collections.Generic.List Quantity { get; set; } /// /// Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.json.cs similarity index 92% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.json.cs index 1b34f0d32d1f..c03beeb66f60 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SplitProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SplitProperties(json) : null; } @@ -77,8 +77,8 @@ internal SplitProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime { return; } - {_quantity = If( json?.PropertyT("quantities"), out var __jsonQuantities) ? If( __jsonQuantities as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(int) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber __t ? (int)__t : default(int))) ))() : null : Quantity;} - {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)ReservationId;} + {_quantity = If( json?.PropertyT("quantities"), out var __jsonQuantities) ? If( __jsonQuantities as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(int) (__u is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNumber __t ? (int)__t : default(int))) ))() : null : _quantity;} + {_reservationId = If( json?.PropertyT("reservationId"), out var __jsonReservationId) ? (string)__jsonReservationId : (string)_reservationId;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.PowerShell.cs similarity index 74% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.PowerShell.cs index 4c40348cc54e..25af1b85a00a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class SplitRequest partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SplitRequest(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SplitRequest(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,21 +111,21 @@ internal SplitRequest(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SplitPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SplitPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Quantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).Quantity = (int[]) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).Quantity, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).Quantity = (System.Collections.Generic.List) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).Quantity, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).ReservationId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -140,15 +140,15 @@ internal SplitRequest(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SplitPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SplitPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Quantity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).Quantity = (int[]) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).Quantity, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).Quantity = (System.Collections.Generic.List) content.GetValueForProperty("Quantity",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).Quantity, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (int) global::System.Convert.ChangeType(__w, typeof(int)))); } if (content.Contains("ReservationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal)this).ReservationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).ReservationId = (string) content.GetValueForProperty("ReservationId",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal)this).ReservationId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.TypeConverter.cs index 8cc37393a750..07a199850780 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.cs similarity index 69% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.cs index 8d613c655434..9a18987d25af 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.cs @@ -3,35 +3,35 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The request for reservation split public partial class SplitRequest : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal { /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SplitProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequestInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SplitProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties _property; /// Properties for reservation split [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SplitProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SplitProperties()); set => this._property = value; } /// List of the quantities in the new reservations to create. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public int[] Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)Property).Quantity = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Quantity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)Property).Quantity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)Property).Quantity = value ?? null /* arrayOf */; } /// /// Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Inlined)] - public string ReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)Property).ReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitPropertiesInternal)Property).ReservationId = value ?? null; } + public string ReservationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)Property).ReservationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitPropertiesInternal)Property).ReservationId = value ?? null; } /// Creates an new instance. public SplitRequest() @@ -47,16 +47,22 @@ public partial interface ISplitRequest : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of the quantities in the new reservations to create.", SerializedName = @"quantities", PossibleTypes = new [] { typeof(int) })] - int[] Quantity { get; set; } + System.Collections.Generic.List Quantity { get; set; } /// /// Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"reservationId", PossibleTypes = new [] { typeof(string) })] @@ -68,9 +74,9 @@ internal partial interface ISplitRequestInternal { /// Properties for reservation split - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitProperties Property { get; set; } /// List of the quantities in the new reservations to create. - int[] Quantity { get; set; } + System.Collections.Generic.List Quantity { get; set; } /// /// Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} /// diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.json.cs similarity index 94% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.json.cs index 03dc8a3b8d80..a19d46a23c0c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SplitRequest.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SplitRequest.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SplitRequest partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SplitRequest(json) : null; } @@ -77,7 +77,7 @@ internal SplitRequest(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Js { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SplitProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SplitProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.PowerShell.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.PowerShell.cs index ad79b279ab65..eef3c437879f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class SubscriptionScopeProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SubscriptionScopeProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SubscriptionScopeProperties(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -113,13 +111,13 @@ internal SubscriptionScopeProperties(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopePropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ScopePropertiesTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopePropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ScopePropertiesTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -134,7 +132,7 @@ internal SubscriptionScopeProperties(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Scope")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopePropertiesInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[]) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ScopePropertiesTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopePropertiesInternal)this).Scope = (System.Collections.Generic.List) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopePropertiesInternal)this).Scope, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ScopePropertiesTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.TypeConverter.cs similarity index 97% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.TypeConverter.cs index 1780ec7c8406..e04ee4302c85 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.cs similarity index 64% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.cs index c994f096575c..5c80d1a3e21a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// The scopes checked by the available scope api. public partial class SubscriptionScopeProperties : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[] _scope; + private System.Collections.Generic.List _scope; [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[] Scope { get => this._scope; set => this._scope = value; } + public System.Collections.Generic.List Scope { get => this._scope; set => this._scope = value; } /// Creates an new instance. public SubscriptionScopeProperties() @@ -32,17 +32,20 @@ public partial interface ISubscriptionScopeProperties : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"", SerializedName = @"scopes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[] Scope { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties) })] + System.Collections.Generic.List Scope { get; set; } } /// The scopes checked by the available scope api. internal partial interface ISubscriptionScopePropertiesInternal { - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IScopeProperties[] Scope { get; set; } + System.Collections.Generic.List Scope { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.json.cs similarity index 90% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.json.cs index 77205094bddb..db31a31dc642 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api20221101/SubscriptionScopeProperties.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SubscriptionScopeProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SubscriptionScopeProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISubscriptionScopeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SubscriptionScopeProperties(json) : null; } @@ -77,7 +77,7 @@ internal SubscriptionScopeProperties(Microsoft.Azure.PowerShell.Cmdlets.Reservat { return; } - {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? If( __jsonScopes as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IScopeProperties) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ScopeProperties.FromJson(__u) )) ))() : null : Scope;} + {_scope = If( json?.PropertyT("scopes"), out var __jsonScopes) ? If( __jsonScopes as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IScopeProperties) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ScopeProperties.FromJson(__u) )) ))() : null : _scope;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 66% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.PowerShell.cs index 065f87e0fabc..4730b83a86ac 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class SystemData partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SystemData(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISyst /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -111,33 +111,33 @@ internal SystemData(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -152,27 +152,27 @@ internal SystemData(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 98% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 204103ed897d..6050a1d62e07 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.cs similarity index 80% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.cs index b8743a6cbeed..df54d3531030 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemDataInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class SystemData : public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + public string CreatedByType { get => this._createdByType; set => this._createdByType = value; } /// Backing field for property. private global::System.DateTime? _lastModifiedAt; @@ -49,11 +49,11 @@ public partial class SystemData : public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Origin(Microsoft.Azure.PowerShell.Cmdlets.Reservations.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + public string LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } /// Creates an new instance. public SystemData() @@ -69,6 +69,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -77,6 +80,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] @@ -85,14 +91,21 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -101,6 +114,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] @@ -109,10 +125,14 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } /// Metadata pertaining to creation and last modification of the resource. @@ -124,13 +144,15 @@ internal partial interface ISystemDataInternal /// The identity that created the resource. string CreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? LastModifiedAt { get; set; } /// The identity that last modified the resource. string LastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.json.cs b/generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.json.cs similarity index 95% rename from generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.json.cs rename to generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.json.cs index d2361d4686cb..8643a34e927e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Models/Api10/SystemData.json.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Models/SystemData.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api10.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +77,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json { return; } - {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} - {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} - {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} - {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} - {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)_createdBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)_createdByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : _createdAt : _createdAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)_lastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)_lastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : _lastModifiedAt : _lastModifiedAt;} AfterFromJson(json); } diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Reservations.cs b/generated/Reservations/Reservations.Autorest/generated/api/Reservations.cs index 6d989bfb5075..e7a03478a9d6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/api/Reservations.cs +++ b/generated/Reservations/Reservations.Autorest/generated/api/Reservations.cs @@ -23,10 +23,11 @@ public partial class Reservations /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CalculateExchangePost(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CalculateExchangePost(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -48,11 +49,11 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CalculateExchangePost_Call(request,onOk,onDefault,eventListener,sender); + await this.CalculateExchangePost_Call (request, onOk,onDefault,eventListener,sender); } } @@ -66,10 +67,11 @@ public partial class Reservations /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CalculateExchangePostViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CalculateExchangePostViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -77,10 +79,10 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/calculateExchange$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/calculateExchange'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity'"); } // replace URI parameters with values from identity @@ -100,15 +102,342 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CalculateExchangePost_Call(request,onOk,onDefault,eventListener,sender); + await this.CalculateExchangePost_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// + /// Calculates price for exchanging `Reservations` if there are no policy errors. + /// + /// + /// Request containing purchases and refunds that need to be executed. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CalculateExchangePostViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-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$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/calculateExchange" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CalculateExchangePostWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Calculates price for exchanging `Reservations` if there are no policy errors. + /// + /// Json string supplied to the CalculateExchangePost operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 CalculateExchangePostViaJsonString(global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/calculateExchange" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CalculateExchangePost_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Calculates price for exchanging `Reservations` if there are no policy errors. + /// + /// Json string supplied to the CalculateExchangePost operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 CalculateExchangePostViaJsonStringWithResult(global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/calculateExchange" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CalculateExchangePostWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Calculates price for exchanging `Reservations` if there are no policy errors. + /// + /// Request containing purchases and refunds that need to be executed. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CalculateExchangePostWithResult(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/calculateExchange" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CalculateExchangePostWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 CalculateExchangePostWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeOperationResultResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -118,32 +447,29 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CalculateExchangePost_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CalculateExchangePost_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -152,15 +478,14 @@ public partial class Reservations if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -169,45 +494,45 @@ public partial class Reservations _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -226,6 +551,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -233,13 +559,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeOperationResultResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeOperationResultResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -263,7 +589,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CalculateExchangePost_Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CalculateExchangePost_Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -282,10 +608,11 @@ public partial class Reservations /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CalculateRefundPost(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CalculateRefundPost(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -309,11 +636,11 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CalculateRefundPost_Call(request,onOk,onDefault,eventListener,sender); + await this.CalculateRefundPost_Call (request, onOk,onDefault,eventListener,sender); } } @@ -327,10 +654,11 @@ public partial class Reservations /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CalculateRefundPostViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CalculateRefundPostViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -338,10 +666,10 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/calculateRefund$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", 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}/calculateRefund'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } // replace URI parameters with values from identity @@ -364,96 +692,125 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CalculateRefundPost_Call(request,onOk,onDefault,eventListener,sender); + await this.CalculateRefundPost_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). + /// + /// Calculate price for returning `Reservations` if there are no policy errors. + /// + /// + /// Information needed for calculating refund of a reservation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CalculateRefundPost_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CalculateRefundPostViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateRefundResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } + + // 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 + + "/calculateRefund" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CalculateRefundPostWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Calculate price for returning `Reservations` if there are no policy errors. /// /// Order Id of the reservation - /// Information needed for calculating refund of a reservation. + /// Json string supplied to the CalculateRefundPost operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 CalculateRefundPost_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task CalculateRefundPostViaJsonString(string reservationOrderId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/calculateRefund" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CalculateRefundPost_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. + /// Calculate price for returning `Reservations` if there are no policy errors. /// - /// Request containing the refunds and purchases that need to be executed. - /// 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). + /// Order Id of the reservation + /// Json string supplied to the CalculateRefundPost operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExchangePost(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CalculateRefundPostViaJsonStringWithResult(string reservationOrderId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -461,91 +818,83 @@ public partial class Reservations { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Capacity/exchange" + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/calculateRefund" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExchangePost_Call(request,onOk,onDefault,eventListener,sender); + return await this.CalculateRefundPostWithResult_Call (request, eventListener,sender); } } /// - /// Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. + /// Calculate price for returning `Reservations` if there are no policy errors. /// - /// - /// Request containing the refunds and purchases that need to be executed. - /// 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). + /// Order Id of the reservation + /// Information needed for calculating refund of a reservation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ExchangePostViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CalculateRefundPostWithResult(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-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/exchange$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/exchange'"); - } - - // replace URI parameters with values from identity // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Capacity/exchange" + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/calculateRefund" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ExchangePost_Call(request,onOk,onDefault,eventListener,sender); + return await this.CalculateRefundPostWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ExchangePost_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CalculateRefundPostWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -553,106 +902,72 @@ public partial class Reservations try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + default: { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + else + { + throw new global::System.Exception($"[{code}] : {message}"); } } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 CalculateRefundPost_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -660,13 +975,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeOperationResultResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -682,36 +997,39 @@ public partial class Reservations } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// - /// Request containing the refunds and purchases that need to be executed. + /// Order Id of the reservation + /// Information needed for calculating refund of a reservation. /// 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 ExchangePost_Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CalculateRefundPost_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } /// - /// Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. + /// Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. /// - /// Id of the subscription + /// Request containing the refunds and purchases that need to be executed. /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GetAppliedReservationList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExchangePost(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -719,9 +1037,7 @@ public partial class Reservations { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.Capacity/appliedReservations" + "/providers/Microsoft.Capacity/exchange" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -730,28 +1046,34 @@ public partial class Reservations // 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.Reservations.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GetAppliedReservationList_Call(request,onOk,onDefault,eventListener,sender); + await this.ExchangePost_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. + /// Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. /// /// + /// Request containing the refunds and purchases that need to be executed. /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GetAppliedReservationListViaIdentity(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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExchangePostViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -759,19 +1081,16 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Capacity/appliedReservations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity'"); } // 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.Capacity/appliedReservations" + "/providers/Microsoft.Capacity/exchange" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -780,28 +1099,2991 @@ public partial class Reservations // 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.Reservations.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GetAppliedReservationList_Call(request,onOk,onDefault,eventListener,sender); + await this.ExchangePost_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). + /// + /// Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. + /// + /// + /// Request containing the refunds and purchases that need to be executed. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GetAppliedReservationList_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ExchangePostViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { - using( NoSynchronizationContext ) + var apiVersion = @"2022-11-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$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/exchange" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExchangePostWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. + /// + /// Json string supplied to the ExchangePost operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ExchangePostViaJsonString(global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/exchange" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ExchangePost_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. + /// + /// Json string supplied to the ExchangePost operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ExchangePostViaJsonStringWithResult(global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/exchange" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExchangePostWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Returns one or more `Reservations` in exchange for one or more `Reservation` purchases. + /// + /// Request containing the refunds and purchases that need to be executed. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ExchangePostWithResult(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/exchange" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ExchangePostWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ExchangePostWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeOperationResultResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ExchangePost_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var _finalUri = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeOperationResultResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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. + /// + /// Request containing the refunds and purchases that need to be executed. + /// 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 ExchangePost_Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. + /// + /// Id of the subscription + /// 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.Reservations.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 GetAppliedReservationList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Capacity/appliedReservations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GetAppliedReservationList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. + /// + /// + /// 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.Reservations.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 GetAppliedReservationListViaIdentity(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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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.Capacity/appliedReservations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations'"); + } + + // 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.Capacity/appliedReservations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GetAppliedReservationList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 GetAppliedReservationListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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.Capacity/appliedReservations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations'"); + } + + // 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.Capacity/appliedReservations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GetAppliedReservationListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription. + /// + /// Id of the subscription + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 GetAppliedReservationListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Capacity/appliedReservations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GetAppliedReservationListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 GetAppliedReservationListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservations.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 GetAppliedReservationList_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AppliedReservations.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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. + /// + /// Id of the subscription + /// 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 GetAppliedReservationList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + } + } + + /// + /// Get the regions and skus that are available for RI purchase for the specified Azure subscription. + /// + /// Id of the subscription + /// The type of the resource for which the skus should be provided. + /// Filters the skus based on the location specified in this parameter. This can be an Azure region + /// or global + /// Publisher id used to get the third party products + /// Offer id used to get the third party products + /// Plan id used to get the third party products + /// May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'. + /// The number of reservations to skip from the list before returning results + /// To number of reservations to return + /// 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.Reservations.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 GetCatalog(string subscriptionId, string reservedResourceType, string location, string publisherId, string offerId, string planId, string Filter, float? Skip, float? Take, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Capacity/catalogs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(reservedResourceType) ? global::System.String.Empty : "reservedResourceType=" + global::System.Uri.EscapeDataString(reservedResourceType)) + + "&" + + (string.IsNullOrEmpty(location) ? global::System.String.Empty : "location=" + global::System.Uri.EscapeDataString(location)) + + "&" + + (string.IsNullOrEmpty(publisherId) ? global::System.String.Empty : "publisherId=" + global::System.Uri.EscapeDataString(publisherId)) + + "&" + + (string.IsNullOrEmpty(offerId) ? global::System.String.Empty : "offerId=" + global::System.Uri.EscapeDataString(offerId)) + + "&" + + (string.IsNullOrEmpty(planId) ? global::System.String.Empty : "planId=" + global::System.Uri.EscapeDataString(planId)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == Take ? global::System.String.Empty : "$take=" + global::System.Uri.EscapeDataString(Take.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GetCatalog_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get the regions and skus that are available for RI purchase for the specified Azure subscription. + /// + /// + /// The type of the resource for which the skus should be provided. + /// Filters the skus based on the location specified in this parameter. This can be an Azure region + /// or global + /// Publisher id used to get the third party products + /// Offer id used to get the third party products + /// Plan id used to get the third party products + /// May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'. + /// The number of reservations to skip from the list before returning results + /// To number of reservations to return + /// 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.Reservations.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 GetCatalogViaIdentity(global::System.String viaIdentity, string reservedResourceType, string location, string publisherId, string offerId, string planId, string Filter, float? Skip, float? Take, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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.Capacity/catalogs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs'"); + } + + // 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.Capacity/catalogs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(reservedResourceType) ? global::System.String.Empty : "reservedResourceType=" + global::System.Uri.EscapeDataString(reservedResourceType)) + + "&" + + (string.IsNullOrEmpty(location) ? global::System.String.Empty : "location=" + global::System.Uri.EscapeDataString(location)) + + "&" + + (string.IsNullOrEmpty(publisherId) ? global::System.String.Empty : "publisherId=" + global::System.Uri.EscapeDataString(publisherId)) + + "&" + + (string.IsNullOrEmpty(offerId) ? global::System.String.Empty : "offerId=" + global::System.Uri.EscapeDataString(offerId)) + + "&" + + (string.IsNullOrEmpty(planId) ? global::System.String.Empty : "planId=" + global::System.Uri.EscapeDataString(planId)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == Take ? global::System.String.Empty : "$take=" + global::System.Uri.EscapeDataString(Take.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GetCatalog_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get the regions and skus that are available for RI purchase for the specified Azure subscription. + /// + /// + /// The type of the resource for which the skus should be provided. + /// Filters the skus based on the location specified in this parameter. This can be an Azure region + /// or global + /// Publisher id used to get the third party products + /// Offer id used to get the third party products + /// Plan id used to get the third party products + /// May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'. + /// The number of reservations to skip from the list before returning results + /// To number of reservations to return + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 GetCatalogViaIdentityWithResult(global::System.String viaIdentity, string reservedResourceType, string location, string publisherId, string offerId, string planId, string Filter, float? Skip, float? Take, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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.Capacity/catalogs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs'"); + } + + // 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.Capacity/catalogs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(reservedResourceType) ? global::System.String.Empty : "reservedResourceType=" + global::System.Uri.EscapeDataString(reservedResourceType)) + + "&" + + (string.IsNullOrEmpty(location) ? global::System.String.Empty : "location=" + global::System.Uri.EscapeDataString(location)) + + "&" + + (string.IsNullOrEmpty(publisherId) ? global::System.String.Empty : "publisherId=" + global::System.Uri.EscapeDataString(publisherId)) + + "&" + + (string.IsNullOrEmpty(offerId) ? global::System.String.Empty : "offerId=" + global::System.Uri.EscapeDataString(offerId)) + + "&" + + (string.IsNullOrEmpty(planId) ? global::System.String.Empty : "planId=" + global::System.Uri.EscapeDataString(planId)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == Take ? global::System.String.Empty : "$take=" + global::System.Uri.EscapeDataString(Take.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GetCatalogWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Get the regions and skus that are available for RI purchase for the specified Azure subscription. + /// + /// Id of the subscription + /// The type of the resource for which the skus should be provided. + /// Filters the skus based on the location specified in this parameter. This can be an Azure region + /// or global + /// Publisher id used to get the third party products + /// Offer id used to get the third party products + /// Plan id used to get the third party products + /// May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'. + /// The number of reservations to skip from the list before returning results + /// To number of reservations to return + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 GetCatalogWithResult(string subscriptionId, string reservedResourceType, string location, string publisherId, string offerId, string planId, string Filter, float? Skip, float? Take, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Capacity/catalogs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(reservedResourceType) ? global::System.String.Empty : "reservedResourceType=" + global::System.Uri.EscapeDataString(reservedResourceType)) + + "&" + + (string.IsNullOrEmpty(location) ? global::System.String.Empty : "location=" + global::System.Uri.EscapeDataString(location)) + + "&" + + (string.IsNullOrEmpty(publisherId) ? global::System.String.Empty : "publisherId=" + global::System.Uri.EscapeDataString(publisherId)) + + "&" + + (string.IsNullOrEmpty(offerId) ? global::System.String.Empty : "offerId=" + global::System.Uri.EscapeDataString(offerId)) + + "&" + + (string.IsNullOrEmpty(planId) ? global::System.String.Empty : "planId=" + global::System.Uri.EscapeDataString(planId)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) + + "&" + + (null == Take ? global::System.String.Empty : "$take=" + global::System.Uri.EscapeDataString(Take.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GetCatalogWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 GetCatalogWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 GetCatalog_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CatalogsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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. + /// + /// Id of the subscription + /// The type of the resource for which the skus should be provided. + /// Filters the skus based on the location specified in this parameter. This can be an Azure region + /// or global + /// Publisher id used to get the third party products + /// Offer id used to get the third party products + /// Plan id used to get the third party products + /// May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'. + /// The number of reservations to skip from the list before returning results + /// To number of reservations to return + /// 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 GetCatalog_Validate(string subscriptionId, string reservedResourceType, string location, string publisherId, string offerId, string planId, string Filter, float? Skip, float? Take, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(reservedResourceType),reservedResourceType); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(publisherId),publisherId); + await eventListener.AssertNotNull(nameof(offerId),offerId); + await eventListener.AssertNotNull(nameof(planId),planId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// List all the 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.Reservations.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 OperationList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List all the 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.Reservations.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 OperationListViaIdentity(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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List all the operations. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 OperationListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationListWithResult_Call (request, eventListener,sender); + } + } + + /// List all the operations. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 OperationListWithResult(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 OperationListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 OperationList_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.OperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 OperationList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// Archiving a `Reservation` moves it to `Archived` state. + /// Order Id of the reservation + /// Id of the reservation item + /// 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.Reservations.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 ReservationArchive(string reservationOrderId, string reservationId, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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) + + "/archive" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationArchive_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Archiving a `Reservation` moves it to `Archived` state. + /// + /// 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.Reservations.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 ReservationArchiveViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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/(?[^/]+)$", 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}'"); + } + + // 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 + + "/archive" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationArchive_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.Reservations.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 ReservationArchive_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 item + /// 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 ReservationArchive_Validate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + await eventListener.AssertNotNull(nameof(reservationId),reservationId); + } + } + + /// + /// Check whether the scopes from request is valid for `Reservation`. + /// + /// Order Id of the reservation + /// Id of the reservation item + /// Scopes to be checked for eligibility. + /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReservationAvailableScopes(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-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) + + "/availableScopes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationAvailableScopes_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Check whether the scopes from request is valid for `Reservation`. + /// + /// + /// Scopes to be checked for eligibility. + /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReservationAvailableScopesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-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/(?[^/]+)$", 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}'"); + } + + // 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 + + "/availableScopes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationAvailableScopes_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Check whether the scopes from request is valid for `Reservation`. + /// + /// + /// Scopes to be checked for eligibility. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReservationAvailableScopesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-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/(?[^/]+)$", 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}'"); + } + + // 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 + + "/availableScopes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationAvailableScopesWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Check whether the scopes from request is valid for `Reservation`. + /// + /// Order Id of the reservation + /// Id of the reservation item + /// Json string supplied to the ReservationAvailableScopes operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationAvailableScopesViaJsonString(string reservationOrderId, string reservationId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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) + + "/availableScopes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationAvailableScopes_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Check whether the scopes from request is valid for `Reservation`. + /// + /// Order Id of the reservation + /// Id of the reservation item + /// Json string supplied to the ReservationAvailableScopes operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationAvailableScopesViaJsonStringWithResult(string reservationOrderId, string reservationId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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) + + "/availableScopes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationAvailableScopesWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Check whether the scopes from request is valid for `Reservation`. + /// + /// Order Id of the reservation + /// Id of the reservation item + /// Scopes to be checked for eligibility. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReservationAvailableScopesWithResult(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-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) + + "/availableScopes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationAvailableScopesWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationAvailableScopesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AvailableScopeProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationAvailableScopes_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AvailableScopeProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 item + /// Scopes to be checked for eligibility. + /// 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 ReservationAvailableScopes_Validate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + await eventListener.AssertNotNull(nameof(reservationId),reservationId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get specific `Reservation` details. + /// Order Id of the reservation + /// Id of the reservation item + /// Supported value of this query is renewProperties + /// 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.Reservations.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 ReservationGet(string reservationOrderId, string reservationId, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get specific `Reservation` details. + /// + /// Supported value of this query is renewProperties + /// 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.Reservations.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 ReservationGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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/(?[^/]+)$", 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}'"); + } + + // 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 + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get specific `Reservation` details. + /// + /// Supported value of this query is renewProperties + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationGetViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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/(?[^/]+)$", 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}'"); + } + + // 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 + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get specific `Reservation` details. + /// Order Id of the reservation + /// Id of the reservation item + /// Supported value of this query is renewProperties + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationGetWithResult(string reservationOrderId, string reservationId, string Expand, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationGet_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 item + /// Supported value of this query is renewProperties + /// 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 ReservationGet_Validate(string reservationOrderId, string reservationId, string Expand, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + await eventListener.AssertNotNull(nameof(reservationId),reservationId); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// List `Reservation`s within a single `ReservationOrder`. + /// Order Id of the reservation + /// 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.Reservations.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 ReservationList(string reservationOrderId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// List the reservations and the roll up counts of reservations group by provisioning states that the user has access to + /// in the current tenant. + /// + /// May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does + /// not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, + /// archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, quantity, + /// renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState} + /// May be used to sort order by reservation properties. + /// To indicate whether to refresh the roll up counts of the reservations group by provisioning + /// states + /// The number of reservations to skip from the list before returning results + /// The selected provisioning state + /// To number of reservations to return + /// 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.Reservations.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 ReservationListAll(string Filter, string Orderby, string refreshSummary, float? Skiptoken, string selectedState, float? take, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + (string.IsNullOrEmpty(refreshSummary) ? global::System.String.Empty : "refreshSummary=" + global::System.Uri.EscapeDataString(refreshSummary)) + + "&" + + (null == Skiptoken ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken.ToString())) + + "&" + + (string.IsNullOrEmpty(selectedState) ? global::System.String.Empty : "selectedState=" + global::System.Uri.EscapeDataString(selectedState)) + + "&" + + (null == take ? global::System.String.Empty : "take=" + global::System.Uri.EscapeDataString(take.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationListAll_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// List the reservations and the roll up counts of reservations group by provisioning states that the user has access to + /// in the current tenant. + /// + /// + /// May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does + /// not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, + /// archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, quantity, + /// renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState} + /// May be used to sort order by reservation properties. + /// To indicate whether to refresh the roll up counts of the reservations group by provisioning + /// states + /// The number of reservations to skip from the list before returning results + /// The selected provisioning state + /// To number of reservations to return + /// 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.Reservations.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 ReservationListAllViaIdentity(global::System.String viaIdentity, string Filter, string Orderby, string refreshSummary, float? Skiptoken, string selectedState, float? take, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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/reservations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + (string.IsNullOrEmpty(refreshSummary) ? global::System.String.Empty : "refreshSummary=" + global::System.Uri.EscapeDataString(refreshSummary)) + + "&" + + (null == Skiptoken ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken.ToString())) + + "&" + + (string.IsNullOrEmpty(selectedState) ? global::System.String.Empty : "selectedState=" + global::System.Uri.EscapeDataString(selectedState)) + + "&" + + (null == take ? global::System.String.Empty : "take=" + global::System.Uri.EscapeDataString(take.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationListAll_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// List the reservations and the roll up counts of reservations group by provisioning states that the user has access to + /// in the current tenant. + /// + /// + /// May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does + /// not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, + /// archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, quantity, + /// renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState} + /// May be used to sort order by reservation properties. + /// To indicate whether to refresh the roll up counts of the reservations group by provisioning + /// states + /// The number of reservations to skip from the list before returning results + /// The selected provisioning state + /// To number of reservations to return + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationListAllViaIdentityWithResult(global::System.String viaIdentity, string Filter, string Orderby, string refreshSummary, float? Skiptoken, string selectedState, float? take, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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/reservations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + (string.IsNullOrEmpty(refreshSummary) ? global::System.String.Empty : "refreshSummary=" + global::System.Uri.EscapeDataString(refreshSummary)) + + "&" + + (null == Skiptoken ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken.ToString())) + + "&" + + (string.IsNullOrEmpty(selectedState) ? global::System.String.Empty : "selectedState=" + global::System.Uri.EscapeDataString(selectedState)) + + "&" + + (null == take ? global::System.String.Empty : "take=" + global::System.Uri.EscapeDataString(take.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationListAllWithResult_Call (request, eventListener,sender); + } + } + + /// + /// List the reservations and the roll up counts of reservations group by provisioning states that the user has access to + /// in the current tenant. + /// + /// May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does + /// not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, + /// archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, quantity, + /// renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState} + /// May be used to sort order by reservation properties. + /// To indicate whether to refresh the roll up counts of the reservations group by provisioning + /// states + /// The number of reservations to skip from the list before returning results + /// The selected provisioning state + /// To number of reservations to return + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationListAllWithResult(string Filter, string Orderby, string refreshSummary, float? Skiptoken, string selectedState, float? take, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) + + "&" + + (string.IsNullOrEmpty(refreshSummary) ? global::System.String.Empty : "refreshSummary=" + global::System.Uri.EscapeDataString(refreshSummary)) + + "&" + + (null == Skiptoken ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken.ToString())) + + "&" + + (string.IsNullOrEmpty(selectedState) ? global::System.String.Empty : "selectedState=" + global::System.Uri.EscapeDataString(selectedState)) + + "&" + + (null == take ? global::System.String.Empty : "take=" + global::System.Uri.EscapeDataString(take.ToString())) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationListAllWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationListAllWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationListAll_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try @@ -810,6 +4092,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -817,13 +4100,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AppliedReservations.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -839,35 +4122,37 @@ public partial class Reservations } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// - /// Id of the subscription + /// May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does + /// not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, + /// archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, quantity, + /// renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState} + /// May be used to sort order by reservation properties. + /// To indicate whether to refresh the roll up counts of the reservations group by provisioning + /// states + /// The number of reservations to skip from the list before returning results + /// The selected provisioning state + /// To number of reservations to return /// 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 GetAppliedReservationList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationListAll_Validate(string Filter, string Orderby, string refreshSummary, float? Skiptoken, string selectedState, float? take, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(Orderby),Orderby); + await eventListener.AssertNotNull(nameof(refreshSummary),refreshSummary); + await eventListener.AssertNotNull(nameof(selectedState),selectedState); } } - /// - /// Get the regions and skus that are available for RI purchase for the specified Azure subscription. - /// - /// Id of the subscription - /// The type of the resource for which the skus should be provided. - /// Filters the skus based on the location specified in this parameter. This can be an Azure region - /// or global - /// Publisher id used to get the third party products - /// Offer id used to get the third party products - /// Plan id used to get the third party products - /// May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'. - /// The number of reservations to skip from the list before returning results - /// To number of reservations to return + /// List of all the revisions for the `Reservation`. + /// Order Id of the reservation + /// Id of the reservation item /// 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). @@ -876,7 +4161,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GetCatalog(string subscriptionId, string reservedResourceType, string location, string publisherId, string offerId, string planId, string Filter, float? Skip, float? Take, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationListRevisions(string reservationOrderId, string reservationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -884,27 +4169,64 @@ public partial class Reservations { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.Capacity/catalogs" + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/reservations/" + + global::System.Uri.EscapeDataString(reservationId) + + "/revisions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationListRevisions_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List of all the revisions for the `Reservation`. + /// + /// 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.Reservations.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 ReservationListRevisionsViaIdentity(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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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/(?[^/]+)/revisions$", 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}/revisions'"); + } + + // 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 + + "/revisions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(reservedResourceType) ? global::System.String.Empty : "reservedResourceType=" + global::System.Uri.EscapeDataString(reservedResourceType)) - + "&" - + (string.IsNullOrEmpty(location) ? global::System.String.Empty : "location=" + global::System.Uri.EscapeDataString(location)) - + "&" - + (string.IsNullOrEmpty(publisherId) ? global::System.String.Empty : "publisherId=" + global::System.Uri.EscapeDataString(publisherId)) - + "&" - + (string.IsNullOrEmpty(offerId) ? global::System.String.Empty : "offerId=" + global::System.Uri.EscapeDataString(offerId)) - + "&" - + (string.IsNullOrEmpty(planId) ? global::System.String.Empty : "planId=" + global::System.Uri.EscapeDataString(planId)) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) - + "&" - + (null == Take ? global::System.String.Empty : "$take=" + global::System.Uri.EscapeDataString(Take.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -916,32 +4238,19 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GetCatalog_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationListRevisions_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Get the regions and skus that are available for RI purchase for the specified Azure subscription. - /// + /// List of all the revisions for the `Reservation`. /// - /// The type of the resource for which the skus should be provided. - /// Filters the skus based on the location specified in this parameter. This can be an Azure region - /// or global - /// Publisher id used to get the third party products - /// Offer id used to get the third party products - /// Plan id used to get the third party products - /// May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'. - /// The number of reservations to skip from the list before returning results - /// To number of reservations to return - /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GetCatalogViaIdentity(global::System.String viaIdentity, string reservedResourceType, string location, string publisherId, string offerId, string planId, string Filter, float? Skip, float? Take, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationListRevisionsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -949,53 +4258,139 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Capacity/catalogs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/reservations/(?[^/]+)/revisions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/revisions'"); } // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; + var reservationOrderId = _match.Groups["reservationOrderId"].Value; + var reservationId = _match.Groups["reservationId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.Capacity/catalogs" + "/providers/Microsoft.Capacity/reservationOrders/" + + reservationOrderId + + "/reservations/" + + reservationId + + "/revisions" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(reservedResourceType) ? global::System.String.Empty : "reservedResourceType=" + global::System.Uri.EscapeDataString(reservedResourceType)) - + "&" - + (string.IsNullOrEmpty(location) ? global::System.String.Empty : "location=" + global::System.Uri.EscapeDataString(location)) - + "&" - + (string.IsNullOrEmpty(publisherId) ? global::System.String.Empty : "publisherId=" + global::System.Uri.EscapeDataString(publisherId)) - + "&" - + (string.IsNullOrEmpty(offerId) ? global::System.String.Empty : "offerId=" + global::System.Uri.EscapeDataString(offerId)) - + "&" - + (string.IsNullOrEmpty(planId) ? global::System.String.Empty : "planId=" + global::System.Uri.EscapeDataString(planId)) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (null == Skip ? global::System.String.Empty : "$skip=" + global::System.Uri.EscapeDataString(Skip.ToString())) - + "&" - + (null == Take ? global::System.String.Empty : "$take=" + global::System.Uri.EscapeDataString(Take.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationListRevisionsWithResult_Call (request, eventListener,sender); + } + } + + /// List of all the revisions for the `Reservation`. + /// Order Id of the reservation + /// Id of the reservation item + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationListRevisionsWithResult(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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) + + "/revisions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GetCatalog_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationListRevisionsWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationListRevisionsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1005,7 +4400,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GetCatalog_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationListRevisions_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1016,6 +4411,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1023,13 +4419,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CatalogsResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1045,38 +4441,26 @@ public partial class Reservations } /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// - /// Id of the subscription - /// The type of the resource for which the skus should be provided. - /// Filters the skus based on the location specified in this parameter. This can be an Azure region - /// or global - /// Publisher id used to get the third party products - /// Offer id used to get the third party products - /// Plan id used to get the third party products - /// May be used to filter by Catalog properties. The filter supports 'eq', 'or', and 'and'. - /// The number of reservations to skip from the list before returning results - /// To number of reservations to return + /// Order Id of the reservation + /// Id of the reservation item /// 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 GetCatalog_Validate(string subscriptionId, string reservedResourceType, string location, string publisherId, string offerId, string planId, string Filter, float? Skip, float? Take, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationListRevisions_Validate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(reservedResourceType),reservedResourceType); - await eventListener.AssertNotNull(nameof(location),location); - await eventListener.AssertNotNull(nameof(publisherId),publisherId); - await eventListener.AssertNotNull(nameof(offerId),offerId); - await eventListener.AssertNotNull(nameof(planId),planId); - await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + await eventListener.AssertNotNull(nameof(reservationId),reservationId); } } - /// List all the operations. + /// List `Reservation`s within a single `ReservationOrder`. + /// /// 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). @@ -1085,15 +4469,27 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationListViaIdentity(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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-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$", 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'"); + } + + // 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/operations" + "/providers/Microsoft.Capacity/reservationOrders/" + + reservationOrderId + + "/reservations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1107,21 +4503,19 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationList_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationList_Call (request, onOk,onDefault,eventListener,sender); } } - /// List all the operations. + /// List `Reservation`s within a single `ReservationOrder`. /// - /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationListViaIdentity(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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -1129,34 +4523,133 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/reservations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/operations'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations'"); } // 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/operations" + "/providers/Microsoft.Capacity/reservationOrders/" + + reservationOrderId + + "/reservations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationListWithResult_Call (request, eventListener,sender); + } + } + + /// List `Reservation`s within a single `ReservationOrder`. + /// Order Id of the reservation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationListWithResult(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.OperationList_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1166,7 +4659,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationList_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationList_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1177,6 +4670,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1184,13 +4678,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.OperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1206,33 +4700,37 @@ public partial class Reservations } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// + /// Order Id of the reservation /// 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 OperationList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationList_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); } } - /// Archiving a `Reservation` moves it to `Archived` state. + /// + /// Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties. + /// /// Order Id of the reservation - /// Id of the reservation item + /// Information needed for commercial request for a reservation /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationArchive(string reservationOrderId, string reservationId, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationMerge(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest body, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -1242,9 +4740,7 @@ public partial class Reservations var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.Capacity/reservationOrders/" + global::System.Uri.EscapeDataString(reservationOrderId) - + "/reservations/" - + global::System.Uri.EscapeDataString(reservationId) - + "/archive" + + "/merge" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1257,22 +4753,30 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationArchive_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationMerge_Call (request, onOk,onDefault,eventListener,sender); } } - /// Archiving a `Reservation` moves it to `Archived` state. + /// + /// Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties. + /// /// + /// Information needed for commercial request for a reservation /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationArchiveViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationMergeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest body, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -1280,22 +4784,19 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/reservations/(?[^/]+)/archive$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", 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}/archive'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } // 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 - + "/archive" + + "/merge" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1308,94 +4809,126 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationArchive_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationMerge_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). + /// + /// Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties. + /// + /// + /// Information needed for commercial request for a reservation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationArchive_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task> ReservationMergeViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } + + // 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 + + "/merge" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationMergeWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties. /// /// Order Id of the reservation - /// Id of the reservation item + /// Json string supplied to the ReservationMerge operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationArchive_Validate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ReservationMergeViaJsonString(string reservationOrderId, global::System.String jsonString, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); - await eventListener.AssertNotNull(nameof(reservationId),reservationId); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/merge" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationMerge_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Check whether the scopes from request is valid for `Reservation`. + /// Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties. /// /// Order Id of the reservation - /// Id of the reservation item - /// Scopes to be checked for eligibility. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the ReservationMerge operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationAvailableScopes(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task> ReservationMergeViaJsonStringWithResult(string reservationOrderId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -1405,89 +4938,226 @@ public partial class Reservations var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.Capacity/reservationOrders/" + global::System.Uri.EscapeDataString(reservationOrderId) - + "/reservations/" - + global::System.Uri.EscapeDataString(reservationId) - + "/availableScopes" + + "/merge" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ReservationAvailableScopes_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationMergeWithResult_Call (request, eventListener,sender); } } /// - /// Check whether the scopes from request is valid for `Reservation`. + /// Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties. /// - /// - /// Scopes to be checked for eligibility. - /// 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). + /// Order Id of the reservation + /// Information needed for commercial request for a reservation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationAvailableScopesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task> ReservationMergeWithResult(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-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/(?[^/]+)/availableScopes$", 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}/availableScopes'"); - } - - // 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 - + "/availableScopes" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/merge" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ReservationAvailableScopes_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationMergeWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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> ReservationMergeWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __y) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(__x) )) ))() : null); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1497,32 +5167,29 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationAvailableScopes_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationMerge_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default + // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -1531,15 +5198,14 @@ public partial class Reservations if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -1548,45 +5214,45 @@ public partial class Reservations _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -1594,20 +5260,18 @@ public partial class Reservations continue; } // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); - // drop the old response - _response?.Dispose(); + // drop the old response + _response?.Dispose(); - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1615,13 +5279,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AvailableScopeProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __y) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(__x) )) ))() : null)); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1637,40 +5301,37 @@ public partial class Reservations } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// Order Id of the reservation - /// Id of the reservation item - /// Scopes to be checked for eligibility. + /// Information needed for commercial request for a reservation /// 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 ReservationAvailableScopes_Validate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationMerge_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); - await eventListener.AssertNotNull(nameof(reservationId),reservationId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get specific `Reservation` details. - /// Order Id of the reservation - /// Id of the reservation item - /// Supported value of this query is renewProperties + /// Calculate price for placing a `ReservationOrder`. + /// Information needed for calculate or purchase reservation /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationGet(string reservationOrderId, string reservationId, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderCalculate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -1678,41 +5339,41 @@ public partial class Reservations { // 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.Capacity/calculatePrice" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationOrderCalculate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get specific `Reservation` details. + /// Calculate price for placing a `ReservationOrder`. /// - /// Supported value of this query is renewProperties + /// Information needed for calculate or purchase reservation /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderCalculateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -1720,41 +5381,266 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/reservations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity$", 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}'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity'"); } // 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.Capacity/calculatePrice" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationOrderCalculate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Calculate price for placing a `ReservationOrder`. + /// + /// Information needed for calculate or purchase reservation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReservationOrderCalculateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-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$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/calculatePrice" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationOrderCalculateWithResult_Call (request, eventListener,sender); + } + } + + /// Calculate price for placing a `ReservationOrder`. + /// Json string supplied to the ReservationOrderCalculate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationOrderCalculateViaJsonString(global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/calculatePrice" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationOrderCalculate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Calculate price for placing a `ReservationOrder`. + /// Json string supplied to the ReservationOrderCalculate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationOrderCalculateViaJsonStringWithResult(global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/calculatePrice" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationOrderCalculateWithResult_Call (request, eventListener,sender); + } + } + + /// Calculate price for placing a `ReservationOrder`. + /// Information needed for calculate or purchase reservation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReservationOrderCalculateWithResult(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/calculatePrice" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ReservationGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationOrderCalculateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationOrderCalculateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1764,7 +5650,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationGet_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationOrderCalculate_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1775,6 +5661,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1782,13 +5669,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculatePriceResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1804,37 +5691,38 @@ public partial class Reservations } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// - /// Order Id of the reservation - /// Id of the reservation item - /// Supported value of this query is renewProperties + /// Information needed for calculate or purchase reservation /// 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 ReservationGet_Validate(string reservationOrderId, string reservationId, string Expand, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationOrderCalculate_Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); - await eventListener.AssertNotNull(nameof(reservationId),reservationId); - await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// List `Reservation`s within a single `ReservationOrder`. + /// + /// Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id + /// /// Order Id of the reservation + /// Information needed to change directory of 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationList(string reservationOrderId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderChangeDirectory(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -1844,7 +5732,7 @@ public partial class Reservations var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.Capacity/reservationOrders/" + global::System.Uri.EscapeDataString(reservationOrderId) - + "/reservations" + + "/changeDirectory" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1853,99 +5741,88 @@ public partial class Reservations // 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.Reservations.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationList_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationOrderChangeDirectory_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// List the reservations and the roll up counts of reservations group by provisioning states that the user has access to - /// in the current tenant. + /// Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id /// - /// May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - /// not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, - /// archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, quantity, - /// renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState} - /// May be used to sort order by reservation properties. - /// To indicate whether to refresh the roll up counts of the reservations group by provisioning - /// states - /// The number of reservations to skip from the list before returning results - /// The selected provisioning state - /// To number of reservations to return + /// + /// Information needed to change directory of 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationListAll(string Filter, string Orderby, string refreshSummary, float? Skiptoken, string selectedState, float? take, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderChangeDirectoryViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-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/(?[^/]+)$", 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}'"); + } + + // 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/reservations" + "/providers/Microsoft.Capacity/reservationOrders/" + + reservationOrderId + + "/changeDirectory" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) - + "&" - + (string.IsNullOrEmpty(refreshSummary) ? global::System.String.Empty : "refreshSummary=" + global::System.Uri.EscapeDataString(refreshSummary)) - + "&" - + (null == Skiptoken ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken.ToString())) - + "&" - + (string.IsNullOrEmpty(selectedState) ? global::System.String.Empty : "selectedState=" + global::System.Uri.EscapeDataString(selectedState)) - + "&" - + (null == take ? global::System.String.Empty : "take=" + global::System.Uri.EscapeDataString(take.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationListAll_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationOrderChangeDirectory_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// List the reservations and the roll up counts of reservations group by provisioning states that the user has access to - /// in the current tenant. + /// Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id /// /// - /// May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - /// not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, - /// archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, quantity, - /// renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState} - /// May be used to sort order by reservation properties. - /// To indicate whether to refresh the roll up counts of the reservations group by provisioning - /// states - /// The number of reservations to skip from the list before returning results - /// The selected provisioning state - /// To number of reservations to return - /// 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). + /// Information needed to change directory of reservation order /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationListAllViaIdentity(global::System.String viaIdentity, string Filter, string Orderby, string refreshSummary, float? Skiptoken, string selectedState, float? take, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderChangeDirectoryViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -1953,47 +5830,45 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservations'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } // 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/reservations" + "/providers/Microsoft.Capacity/reservationOrders/" + + reservationOrderId + + "/changeDirectory" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (string.IsNullOrEmpty(Orderby) ? global::System.String.Empty : "$orderby=" + global::System.Uri.EscapeDataString(Orderby)) - + "&" - + (string.IsNullOrEmpty(refreshSummary) ? global::System.String.Empty : "refreshSummary=" + global::System.Uri.EscapeDataString(refreshSummary)) - + "&" - + (null == Skiptoken ? global::System.String.Empty : "$skiptoken=" + global::System.Uri.EscapeDataString(Skiptoken.ToString())) - + "&" - + (string.IsNullOrEmpty(selectedState) ? global::System.String.Empty : "selectedState=" + global::System.Uri.EscapeDataString(selectedState)) - + "&" - + (null == take ? global::System.String.Empty : "take=" + global::System.Uri.EscapeDataString(take.ToString())) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ReservationListAll_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationOrderChangeDirectoryWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// + /// Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id + /// + /// Order Id of the reservation + /// Json string supplied to the ReservationOrderChangeDirectory operation /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -2002,86 +5877,50 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationListAll_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderChangeDirectoryViaJsonString(string reservationOrderId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/changeDirectory" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationsListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationOrderChangeDirectory_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id /// - /// May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does - /// not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, - /// archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, quantity, - /// renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState} - /// May be used to sort order by reservation properties. - /// To indicate whether to refresh the roll up counts of the reservations group by provisioning - /// states - /// The number of reservations to skip from the list before returning results - /// The selected provisioning state - /// To number of reservations to return - /// 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 ReservationListAll_Validate(string Filter, string Orderby, string refreshSummary, float? Skiptoken, string selectedState, float? take, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(Filter),Filter); - await eventListener.AssertNotNull(nameof(Orderby),Orderby); - await eventListener.AssertNotNull(nameof(refreshSummary),refreshSummary); - await eventListener.AssertNotNull(nameof(selectedState),selectedState); - } - } - - /// List of all the revisions for the `Reservation`. /// Order Id of the reservation - /// Id of the reservation item - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the ReservationOrderChangeDirectory operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationListRevisions(string reservationOrderId, string reservationId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderChangeDirectoryViaJsonStringWithResult(string reservationOrderId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -2091,88 +5930,83 @@ public partial class Reservations var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.Capacity/reservationOrders/" + global::System.Uri.EscapeDataString(reservationOrderId) - + "/reservations/" - + global::System.Uri.EscapeDataString(reservationId) - + "/revisions" + + "/changeDirectory" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ReservationListRevisions_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationOrderChangeDirectoryWithResult_Call (request, eventListener,sender); } } - /// List of all the revisions for the `Reservation`. - /// - /// 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). + /// + /// Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id + /// + /// Order Id of the reservation + /// Information needed to change directory of reservation order /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationListRevisionsViaIdentity(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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) - { - var apiVersion = @"2022-11-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/(?[^/]+)/revisions$", 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}/revisions'"); - } - - // replace URI parameters with values from identity - var reservationOrderId = _match.Groups["reservationOrderId"].Value; - var reservationId = _match.Groups["reservationId"].Value; + public async global::System.Threading.Tasks.Task ReservationOrderChangeDirectoryWithResult(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.Capacity/reservationOrders/" - + reservationOrderId - + "/reservations/" - + reservationId - + "/revisions" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/changeDirectory" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ReservationListRevisions_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationOrderChangeDirectoryWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationListRevisions_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationOrderChangeDirectoryWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2180,24 +6014,37 @@ public partial class Reservations try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { case global::System.Net.HttpStatusCode.OK: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -2211,74 +6058,7 @@ public partial class Reservations } } - /// - /// 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 item - /// 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 ReservationListRevisions_Validate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); - await eventListener.AssertNotNull(nameof(reservationId),reservationId); - } - } - - /// List `Reservation`s within a single `ReservationOrder`. - /// - /// 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.Reservations.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 ReservationListViaIdentity(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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) - { - var apiVersion = @"2022-11-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$", 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'"); - } - - // 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 - + "/reservations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ReservationList_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2288,7 +6068,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationList_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationOrderChangeDirectory_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2299,6 +6079,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2306,13 +6087,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2328,27 +6109,28 @@ public partial class Reservations } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// Order Id of the reservation + /// Information needed to change directory of 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 ReservationList_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationOrderChangeDirectory_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties. - /// + /// Get the details of the `ReservationOrder`. /// Order Id of the reservation - /// Information needed for commercial request for a reservation + /// May be used to expand the planInformation. /// 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). @@ -2357,7 +6139,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationMerge(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderGet(string reservationOrderId, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -2367,33 +6149,28 @@ public partial class Reservations var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.Capacity/reservationOrders/" + global::System.Uri.EscapeDataString(reservationOrderId) - + "/merge" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationMerge_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationOrderGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties. - /// + /// Get the details of the `ReservationOrder`. /// - /// Information needed for commercial request for a reservation + /// May be used to expand the planInformation. /// 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). @@ -2402,7 +6179,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationMergeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -2410,10 +6187,10 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/merge$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", 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}/merge'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } // replace URI parameters with values from identity @@ -2422,205 +6199,83 @@ public partial class Reservations var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.Capacity/reservationOrders/" + reservationOrderId - + "/merge" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationMerge_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationOrderGet_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). + /// Get the details of the `ReservationOrder`. + /// + /// May be used to expand the planInformation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationMerge_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderGetViaIdentityWithResult(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __y) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponse.FromJson(__x) )) ))() : null)); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// Order Id of the reservation - /// Information needed for commercial request for a reservation - /// 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 ReservationMerge_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // 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 + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationOrderGetWithResult_Call (request, eventListener,sender); } } - /// Calculate price for placing a `ReservationOrder`. - /// Information needed for calculate or purchase reservation - /// 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). + /// Get the details of the `ReservationOrder`. + /// Order Id of the reservation + /// May be used to expand the planInformation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationOrderCalculate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderGetWithResult(string reservationOrderId, string Expand, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -2628,79 +6283,88 @@ public partial class Reservations { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Capacity/calculatePrice" + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ReservationOrderCalculate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationOrderGetWithResult_Call (request, eventListener,sender); } } - /// Calculate price for placing a `ReservationOrder`. - /// - /// Information needed for calculate or purchase reservation - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationOrderCalculateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationOrderGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { - var apiVersion = @"2022-11-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/calculatePrice$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/calculatePrice'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Capacity/calculatePrice" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ReservationOrderCalculate_Call(request,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2710,7 +6374,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationOrderCalculate_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationOrderGet_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2721,6 +6385,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2728,13 +6393,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculatePriceResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2750,28 +6415,27 @@ public partial class Reservations } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// - /// Information needed for calculate or purchase reservation + /// Order Id of the reservation + /// May be used to expand the planInformation. /// 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 ReservationOrderCalculate_Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationOrderGet_Validate(string reservationOrderId, string Expand, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); + await eventListener.AssertNotNull(nameof(Expand),Expand); } } /// - /// Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id + /// List of all the `ReservationOrder`s that the user has access to in the current tenant. /// - /// Order Id of the reservation - /// Information needed to change directory of 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). @@ -2780,7 +6444,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationOrderChangeDirectory(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -2788,9 +6452,7 @@ public partial class Reservations { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Capacity/reservationOrders/" - + global::System.Uri.EscapeDataString(reservationOrderId) - + "/changeDirectory" + "/providers/Microsoft.Capacity/reservationOrders" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2799,24 +6461,19 @@ public partial class Reservations // 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.Reservations.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationOrderChangeDirectory_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationOrderList_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id + /// List of all the `ReservationOrder`s that the user has access to in the current tenant. /// /// - /// Information needed to change directory of 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). @@ -2825,7 +6482,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationOrderChangeDirectoryViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderListViaIdentity(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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -2833,19 +6490,16 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/changeDirectory$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders$", 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}/changeDirectory'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders'"); } // 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 - + "/changeDirectory" + "/providers/Microsoft.Capacity/reservationOrders" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2854,100 +6508,70 @@ public partial class Reservations // 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.Reservations.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationOrderChangeDirectory_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationOrderList_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). + /// + /// List of all the `ReservationOrder`s that the user has access to in the current tenant. + /// + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationOrderChangeDirectory_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { + var apiVersion = @"2022-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders'"); } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationOrderListWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// List of all the `ReservationOrder`s that the user has access to in the current tenant. /// - /// Order Id of the reservation - /// Information needed to change directory of 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 ReservationOrderChangeDirectory_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Get the details of the `ReservationOrder`. - /// Order Id of the reservation - /// May be used to expand the planInformation. - /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationOrderGet(string reservationOrderId, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderListWithResult(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -2955,78 +6579,85 @@ public partial class Reservations { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Capacity/reservationOrders/" - + global::System.Uri.EscapeDataString(reservationOrderId) + "/providers/Microsoft.Capacity/reservationOrders" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ReservationOrderGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationOrderListWithResult_Call (request, eventListener,sender); } } - /// Get the details of the `ReservationOrder`. - /// - /// May be used to expand the planInformation. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationOrderGetViaIdentity(global::System.String viaIdentity, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationOrderListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { - var apiVersion = @"2022-11-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/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); - } - - // 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 - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - + "&" - + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ReservationOrderGet_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3036,7 +6667,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationOrderGet_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationOrderList_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3047,6 +6678,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3054,13 +6686,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3076,36 +6708,34 @@ public partial class Reservations } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// - /// Order Id of the reservation - /// May be used to expand the planInformation. /// 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 ReservationOrderGet_Validate(string reservationOrderId, string Expand, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationOrderList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(reservationOrderId),reservationOrderId); - await eventListener.AssertNotNull(nameof(Expand),Expand); + } } - /// - /// List of all the `ReservationOrder`s that the user has access to in the current tenant. - /// + /// Purchase `ReservationOrder` and purchase resource under the specified URI. + /// Order Id of the reservation + /// Information needed for calculate or purchase reservation /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationOrderList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderPurchase(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -3113,7 +6743,8 @@ public partial class Reservations { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.Capacity/reservationOrders" + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3122,28 +6753,32 @@ public partial class Reservations // 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.Reservations.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationOrderList_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationOrderPurchase_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// List of all the `ReservationOrder`s that the user has access to in the current tenant. - /// + /// Purchase `ReservationOrder` and purchase resource under the specified URI. /// + /// Information needed for calculate or purchase reservation /// 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.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationOrderListViaIdentity(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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderPurchaseViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -3151,16 +6786,18 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } // 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" + "/providers/Microsoft.Capacity/reservationOrders/" + + reservationOrderId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3169,83 +6806,73 @@ public partial class Reservations // 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.Reservations.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationOrderList_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationOrderPurchase_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). + /// Purchase `ReservationOrder` and purchase resource under the specified URI. + /// + /// Information needed for calculate or purchase reservation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationOrderList_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderPurchaseViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2022-11-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } - } - } - /// - /// 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 ReservationOrderList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { + // 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 + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationOrderPurchaseWithResult_Call (request, eventListener,sender); } } - /// Purchase `ReservationOrder` and create resource under the specified URI. + /// Purchase `ReservationOrder` and purchase resource under the specified URI. /// Order Id of the reservation - /// Information needed for calculate or purchase reservation + /// Json string supplied to the ReservationOrderPurchase operation /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -3254,7 +6881,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationOrderPurchase(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderPurchaseViaJsonString(string reservationOrderId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -3277,67 +6904,249 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationOrderPurchase_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationOrderPurchase_Call (request, onOk,onDefault,eventListener,sender); } } - /// Purchase `ReservationOrder` and create resource under the specified URI. - /// - /// Information needed for calculate or purchase reservation - /// 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). + /// Purchase `ReservationOrder` and purchase resource under the specified URI. + /// Order Id of the reservation + /// Json string supplied to the ReservationOrderPurchase operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationOrderPurchaseViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationOrderPurchaseViaJsonStringWithResult(string reservationOrderId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", 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}'"); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var reservationOrderId = _match.Groups["reservationOrderId"].Value; + // 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.Reservations.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationOrderPurchaseWithResult_Call (request, eventListener,sender); + } + } + + /// Purchase `ReservationOrder` and purchase resource under the specified URI. + /// Order Id of the reservation + /// Information needed for calculate or purchase reservation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReservationOrderPurchaseWithResult(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/providers/Microsoft.Capacity/reservationOrders/" - + reservationOrderId + + global::System.Uri.EscapeDataString(reservationOrderId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ReservationOrderPurchase_Call(request,onOk,onDefault,eventListener,sender); + return await this.ReservationOrderPurchaseWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationOrderPurchaseWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3347,32 +7156,29 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationOrderPurchase_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationOrderPurchase_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -3381,15 +7187,14 @@ public partial class Reservations if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -3398,45 +7203,45 @@ public partial class Reservations _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -3455,6 +7260,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3462,13 +7268,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3493,7 +7299,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationOrderPurchase_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationOrderPurchase_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3513,10 +7319,11 @@ public partial class Reservations /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationSplit(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationSplit(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest body, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -3540,11 +7347,11 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationSplit_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationSplit_Call (request, onOk,onDefault,eventListener,sender); } } @@ -3558,10 +7365,65 @@ public partial class Reservations /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationSplitViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationSplitViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest body, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-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/(?[^/]+)$", 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}'"); + } + + // 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 + + "/split" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationSplit_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Split a `Reservation` into two `Reservation`s with specified quantity distribution. + /// + /// + /// Information needed to Split a reservation item + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task> ReservationSplitViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -3569,10 +7431,10 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/split$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", 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}/split'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } // replace URI parameters with values from identity @@ -3586,6 +7448,51 @@ public partial class Reservations + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationSplitWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Split a `Reservation` into two `Reservation`s with specified quantity distribution. + /// + /// Order Id of the reservation + /// Json string supplied to the ReservationSplit operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationSplitViaJsonString(string reservationOrderId, global::System.String jsonString, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/split" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object @@ -3595,15 +7502,255 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationSplit_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationSplit_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Split a `Reservation` into two `Reservation`s with specified quantity distribution. + /// + /// Order Id of the reservation + /// Json string supplied to the ReservationSplit operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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> ReservationSplitViaJsonStringWithResult(string reservationOrderId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/split" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationSplitWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Split a `Reservation` into two `Reservation`s with specified quantity distribution. + /// + /// Order Id of the reservation + /// Information needed to Split a reservation item + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task> ReservationSplitWithResult(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/split" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationSplitWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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> ReservationSplitWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __y) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(__x) )) ))() : null); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3613,32 +7760,29 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationSplit_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationSplit_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -3647,15 +7791,14 @@ public partial class Reservations if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -3664,45 +7807,45 @@ public partial class Reservations _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -3721,6 +7864,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3728,13 +7872,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __y) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponse.FromJson(__x) )) ))() : null)); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonArray, out var __y) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__y, (__x)=>(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse) (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(__x) )) ))() : null)); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3759,7 +7903,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationSplit_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationSplit_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3782,7 +7926,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationUnarchive(string reservationOrderId, string reservationId, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationUnarchive(string reservationOrderId, string reservationId, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -3808,7 +7952,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationUnarchive_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationUnarchive_Call (request, onOk,onDefault,eventListener,sender); } } @@ -3824,7 +7968,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationUnarchiveViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationUnarchiveViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -3832,10 +7976,10 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/reservations/(?[^/]+)/unarchive$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/reservations/(?[^/]+)$", 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}/unarchive'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}'"); } // replace URI parameters with values from identity @@ -3861,11 +8005,11 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationUnarchive_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationUnarchive_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -3875,7 +8019,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationUnarchive_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationUnarchive_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3886,6 +8030,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3899,7 +8044,7 @@ public partial class Reservations default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3933,7 +8078,7 @@ public partial class Reservations } } - /// Updates the applied scopes of the `Reservation`. + /// update the applied scopes of the `Reservation`. /// Order Id of the reservation /// Id of the reservation item /// Information needed to patch a reservation item @@ -3942,10 +8087,11 @@ public partial class Reservations /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationUpdate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationUpdate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -3970,15 +8116,15 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Updates the applied scopes of the `Reservation`. + /// update the applied scopes of the `Reservation`. /// /// Information needed to patch a reservation item /// a delegate that is called when the remote service returns 200 (OK). @@ -3986,10 +8132,65 @@ public partial class Reservations /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReservationUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReservationUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-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/(?[^/]+)$", 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}'"); + } + + // 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 + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReservationUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update the applied scopes of the `Reservation`. + /// + /// Information needed to patch a reservation item + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReservationUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -4016,6 +8217,51 @@ public partial class Reservations + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the applied scopes of the `Reservation`. + /// Order Id of the reservation + /// Id of the reservation item + /// Json string supplied to the ReservationUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationUpdateViaJsonString(string reservationOrderId, string reservationId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object @@ -4025,15 +8271,254 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReservationUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ReservationUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update the applied scopes of the `Reservation`. + /// Order Id of the reservation + /// Id of the reservation item + /// Json string supplied to the ReservationUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationUpdateViaJsonStringWithResult(string reservationOrderId, string reservationId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-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) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update the applied scopes of the `Reservation`. + /// Order Id of the reservation + /// Id of the reservation item + /// Information needed to patch a reservation item + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReservationUpdateWithResult(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-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) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReservationUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReservationUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -4043,31 +8528,28 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationUpdate_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReservationUpdate_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -4076,15 +8558,14 @@ public partial class Reservations if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -4093,45 +8574,45 @@ public partial class Reservations _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -4150,6 +8631,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4157,13 +8639,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4189,7 +8671,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReservationUpdate_Validate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReservationUpdate_Validate(string reservationOrderId, string reservationId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -4208,10 +8690,11 @@ public partial class Reservations /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReturnPost(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReturnPost(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -4235,11 +8718,11 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReturnPost_Call(request,onOk,onDefault,eventListener,sender); + await this.ReturnPost_Call (request, onOk,onDefault,eventListener,sender); } } @@ -4251,10 +8734,63 @@ public partial class Reservations /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ReturnPostViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ReturnPostViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-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/(?[^/]+)$", 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}'"); + } + + // 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 + + "/return" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ReturnPost_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Return a reservation and get refund information. + /// + /// Information needed for returning reservation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReturnPostViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2022-11-01"; // Constant Parameters @@ -4262,10 +8798,10 @@ public partial class Reservations { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)/return$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Capacity/reservationOrders/(?[^/]+)$", 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}/return'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}'"); } // replace URI parameters with values from identity @@ -4279,6 +8815,49 @@ public partial class Reservations + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReturnPostWithResult_Call (request, eventListener,sender); + } + } + + /// Return a reservation and get refund information. + /// Order Id of the reservation + /// Json string supplied to the ReturnPost operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReturnPostViaJsonString(string reservationOrderId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/return" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object @@ -4288,15 +8867,251 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ReturnPost_Call(request,onOk,onDefault,eventListener,sender); + await this.ReturnPost_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Return a reservation and get refund information. + /// Order Id of the reservation + /// Json string supplied to the ReturnPost operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReturnPostViaJsonStringWithResult(string reservationOrderId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/return" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReturnPostWithResult_Call (request, eventListener,sender); + } + } + + /// Return a reservation and get refund information. + /// Order Id of the reservation + /// Information needed for returning reservation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ReturnPostWithResult(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2022-11-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Capacity/reservationOrders/" + + global::System.Uri.EscapeDataString(reservationOrderId) + + "/return" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ReturnPostWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 ReturnPostWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -4306,32 +9121,29 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReturnPost_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ReturnPost_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.Reservations.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -4340,15 +9152,14 @@ public partial class Reservations if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -4357,45 +9168,45 @@ public partial class Reservations _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -4414,6 +9225,7 @@ public partial class Reservations await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4421,13 +9233,13 @@ public partial class Reservations case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ReservationOrderResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ReservationOrderResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4452,7 +9264,7 @@ public partial class Reservations /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ReturnPost_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ReturnPost_Validate(string reservationOrderId, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest body, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/AppliedScopeType.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/AppliedScopeType.Completer.cs deleted file mode 100644 index 318773839056..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/AppliedScopeType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Type of the Applied Scope. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeTypeTypeConverter))] - public partial struct AppliedScopeType : - 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"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagementGroup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ManagementGroup'", "ManagementGroup", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagementGroup"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/AppliedScopeType.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/AppliedScopeType.TypeConverter.cs deleted file mode 100644 index 3527484650f6..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/AppliedScopeType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Type of the Applied Scope. - public partial class AppliedScopeTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => AppliedScopeType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/AppliedScopeType.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/AppliedScopeType.cs deleted file mode 100644 index f8843f68ba73..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/AppliedScopeType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Type of the Applied Scope. - public partial struct AppliedScopeType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType ManagementGroup = @"ManagementGroup"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType Shared = @"Shared"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType Single = @"Single"; - - /// 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 AppliedScopeType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AppliedScopeType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AppliedScopeType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AppliedScopeType - /// 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.Reservations.Support.AppliedScopeType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AppliedScopeType (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 AppliedScopeType && Equals((AppliedScopeType)obj); - } - - /// Returns hashCode for enum AppliedScopeType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AppliedScopeType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AppliedScopeType - /// the value to convert to an instance of . - - public static implicit operator AppliedScopeType(string value) - { - return new AppliedScopeType(value); - } - - /// Implicit operator to convert AppliedScopeType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType e) - { - return e._value; - } - - /// Overriding != operator for enum AppliedScopeType - /// 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.Reservations.Support.AppliedScopeType e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AppliedScopeType - /// 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.Reservations.Support.AppliedScopeType e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/BillingPlan.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/BillingPlan.Completer.cs deleted file mode 100644 index 79eb79b62c4b..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/BillingPlan.Completer.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlanTypeConverter))] - public partial struct BillingPlan : - 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) || "P1M".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'P1M'", "P1M", global::System.Management.Automation.CompletionResultType.ParameterValue, "P1M"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/BillingPlan.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/BillingPlan.TypeConverter.cs deleted file mode 100644 index d9048e3761d7..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/BillingPlan.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. - /// - public partial class BillingPlanTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => BillingPlan.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/BillingPlan.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/BillingPlan.cs deleted file mode 100644 index f718da8512bc..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/BillingPlan.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Represents the billing plan in ISO 8601 format. Required only for monthly billing plans. - /// - public partial struct BillingPlan : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan P1M = @"P1M"; - - /// 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 BillingPlan(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BillingPlan - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BillingPlan(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BillingPlan - /// 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.Reservations.Support.BillingPlan e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BillingPlan (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 BillingPlan && Equals((BillingPlan)obj); - } - - /// Returns hashCode for enum BillingPlan - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BillingPlan - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BillingPlan - /// the value to convert to an instance of . - - public static implicit operator BillingPlan(string value) - { - return new BillingPlan(value); - } - - /// Implicit operator to convert BillingPlan to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan e) - { - return e._value; - } - - /// Overriding != operator for enum BillingPlan - /// 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.Reservations.Support.BillingPlan e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BillingPlan - /// 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.Reservations.Support.BillingPlan e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.BillingPlan e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/CalculateExchangeOperationResultStatus.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/CalculateExchangeOperationResultStatus.Completer.cs deleted file mode 100644 index d8337401c73d..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/CalculateExchangeOperationResultStatus.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Status of the operation. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatusTypeConverter))] - public partial struct CalculateExchangeOperationResultStatus : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/CalculateExchangeOperationResultStatus.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/CalculateExchangeOperationResultStatus.TypeConverter.cs deleted file mode 100644 index 3eee9bbe82c7..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/CalculateExchangeOperationResultStatus.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Status of the operation. - public partial class CalculateExchangeOperationResultStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => CalculateExchangeOperationResultStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/CalculateExchangeOperationResultStatus.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/CalculateExchangeOperationResultStatus.cs deleted file mode 100644 index dfa82e218388..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/CalculateExchangeOperationResultStatus.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Status of the operation. - public partial struct CalculateExchangeOperationResultStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus Pending = @"Pending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus Succeeded = @"Succeeded"; - - /// - /// 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 CalculateExchangeOperationResultStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to CalculateExchangeOperationResultStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CalculateExchangeOperationResultStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CalculateExchangeOperationResultStatus - /// 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.Reservations.Support.CalculateExchangeOperationResultStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type CalculateExchangeOperationResultStatus (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 CalculateExchangeOperationResultStatus && Equals((CalculateExchangeOperationResultStatus)obj); - } - - /// Returns hashCode for enum CalculateExchangeOperationResultStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CalculateExchangeOperationResultStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CalculateExchangeOperationResultStatus - /// the value to convert to an instance of . - - public static implicit operator CalculateExchangeOperationResultStatus(string value) - { - return new CalculateExchangeOperationResultStatus(value); - } - - /// Implicit operator to convert CalculateExchangeOperationResultStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus e) - { - return e._value; - } - - /// Overriding != operator for enum CalculateExchangeOperationResultStatus - /// 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.Reservations.Support.CalculateExchangeOperationResultStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CalculateExchangeOperationResultStatus - /// 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.Reservations.Support.CalculateExchangeOperationResultStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CalculateExchangeOperationResultStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/CommitmentGrain.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/CommitmentGrain.Completer.cs deleted file mode 100644 index 91c7986d7125..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/CommitmentGrain.Completer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Commitment grain. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrainTypeConverter))] - public partial struct CommitmentGrain : - 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) || "Hourly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Hourly'", "Hourly", global::System.Management.Automation.CompletionResultType.ParameterValue, "Hourly"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/CommitmentGrain.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/CommitmentGrain.TypeConverter.cs deleted file mode 100644 index 1848a343a101..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/CommitmentGrain.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Commitment grain. - public partial class CommitmentGrainTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => CommitmentGrain.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/CommitmentGrain.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/CommitmentGrain.cs deleted file mode 100644 index 92e6707dcd39..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/CommitmentGrain.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Commitment grain. - public partial struct CommitmentGrain : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain Hourly = @"Hourly"; - - /// 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 CommitmentGrain(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to CommitmentGrain - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CommitmentGrain(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CommitmentGrain - /// 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.Reservations.Support.CommitmentGrain e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CommitmentGrain (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 CommitmentGrain && Equals((CommitmentGrain)obj); - } - - /// Returns hashCode for enum CommitmentGrain - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CommitmentGrain - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CommitmentGrain - /// the value to convert to an instance of . - - public static implicit operator CommitmentGrain(string value) - { - return new CommitmentGrain(value); - } - - /// Implicit operator to convert CommitmentGrain to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain e) - { - return e._value; - } - - /// Overriding != operator for enum CommitmentGrain - /// 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.Reservations.Support.CommitmentGrain e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CommitmentGrain - /// 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.Reservations.Support.CommitmentGrain e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CommitmentGrain e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index 21e4da8e8675..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/CreatedByType.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByTypeTypeConverter))] - public partial struct CreatedByType : - 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) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ManagedIdentity'", "ManagedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedIdentity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Key".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Key'", "Key", global::System.Management.Automation.CompletionResultType.ParameterValue, "Key"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index 2bc87934cf98..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The type of identity that created the resource. - public partial class CreatedByTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => CreatedByType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/CreatedByType.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index 99f1e67d82bf..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/CreatedByType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType User = @"User"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to CreatedByType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CreatedByType(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private CreatedByType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type CreatedByType - /// 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.Reservations.Support.CreatedByType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CreatedByType (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 CreatedByType && Equals((CreatedByType)obj); - } - - /// Returns hashCode for enum CreatedByType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CreatedByType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CreatedByType - /// the value to convert to an instance of . - - public static implicit operator CreatedByType(string value) - { - return new CreatedByType(value); - } - - /// Implicit operator to convert CreatedByType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType e) - { - return e._value; - } - - /// Overriding != operator for enum CreatedByType - /// 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.Reservations.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CreatedByType - /// 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.Reservations.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/DisplayProvisioningState.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/DisplayProvisioningState.Completer.cs deleted file mode 100644 index e1469b0ceb0f..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/DisplayProvisioningState.Completer.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the current display state of the reservation. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningStateTypeConverter))] - public partial struct DisplayProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Expiring".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Expiring'", "Expiring", global::System.Management.Automation.CompletionResultType.ParameterValue, "Expiring"); - } - 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) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Processing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Processing'", "Processing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Processing"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Warning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Warning'", "Warning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NoBenefit".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NoBenefit'", "NoBenefit", global::System.Management.Automation.CompletionResultType.ParameterValue, "NoBenefit"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/DisplayProvisioningState.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/DisplayProvisioningState.TypeConverter.cs deleted file mode 100644 index 3bfa86c8ed48..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/DisplayProvisioningState.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the current display state of the reservation. - public partial class DisplayProvisioningStateTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => DisplayProvisioningState.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/DisplayProvisioningState.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/DisplayProvisioningState.cs deleted file mode 100644 index cf7950177cac..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/DisplayProvisioningState.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the current display state of the reservation. - public partial struct DisplayProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState Expired = @"Expired"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState Expiring = @"Expiring"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState NoBenefit = @"NoBenefit"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState Pending = @"Pending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState Processing = @"Processing"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState Warning = @"Warning"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DisplayProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DisplayProvisioningState(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DisplayProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DisplayProvisioningState - /// 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.Reservations.Support.DisplayProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DisplayProvisioningState (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 DisplayProvisioningState && Equals((DisplayProvisioningState)obj); - } - - /// Returns hashCode for enum DisplayProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DisplayProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DisplayProvisioningState - /// the value to convert to an instance of . - - public static implicit operator DisplayProvisioningState(string value) - { - return new DisplayProvisioningState(value); - } - - /// Implicit operator to convert DisplayProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum DisplayProvisioningState - /// 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.Reservations.Support.DisplayProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DisplayProvisioningState - /// 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.Reservations.Support.DisplayProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.DisplayProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ErrorResponseCode.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ErrorResponseCode.Completer.cs deleted file mode 100644 index 91df80e19f33..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ErrorResponseCode.Completer.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCodeTypeConverter))] - public partial struct ErrorResponseCode : - 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) || "NotSpecified".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NotSpecified'", "NotSpecified", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotSpecified"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InternalServerError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InternalServerError'", "InternalServerError", global::System.Management.Automation.CompletionResultType.ParameterValue, "InternalServerError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ServerTimeout".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ServerTimeout'", "ServerTimeout", global::System.Management.Automation.CompletionResultType.ParameterValue, "ServerTimeout"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AuthorizationFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AuthorizationFailed'", "AuthorizationFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "AuthorizationFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BadRequest".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BadRequest'", "BadRequest", global::System.Management.Automation.CompletionResultType.ParameterValue, "BadRequest"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ClientCertificateThumbprintNotSet".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ClientCertificateThumbprintNotSet'", "ClientCertificateThumbprintNotSet", global::System.Management.Automation.CompletionResultType.ParameterValue, "ClientCertificateThumbprintNotSet"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidRequestContent".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidRequestContent'", "InvalidRequestContent", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidRequestContent"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "OperationFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'OperationFailed'", "OperationFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "OperationFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "HttpMethodNotSupported".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'HttpMethodNotSupported'", "HttpMethodNotSupported", global::System.Management.Automation.CompletionResultType.ParameterValue, "HttpMethodNotSupported"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidRequestUri".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidRequestUri'", "InvalidRequestUri", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidRequestUri"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MissingTenantId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MissingTenantId'", "MissingTenantId", global::System.Management.Automation.CompletionResultType.ParameterValue, "MissingTenantId"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidTenantId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidTenantId'", "InvalidTenantId", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidTenantId"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidReservationOrderId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidReservationOrderId'", "InvalidReservationOrderId", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidReservationOrderId"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidReservationId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidReservationId'", "InvalidReservationId", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidReservationId"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReservationIdNotInReservationOrder".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ReservationIdNotInReservationOrder'", "ReservationIdNotInReservationOrder", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReservationIdNotInReservationOrder"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReservationOrderNotFound".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ReservationOrderNotFound'", "ReservationOrderNotFound", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReservationOrderNotFound"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidSubscriptionId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidSubscriptionId'", "InvalidSubscriptionId", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidSubscriptionId"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidAccessToken".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidAccessToken'", "InvalidAccessToken", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidAccessToken"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidLocationId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidLocationId'", "InvalidLocationId", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidLocationId"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UnauthenticatedRequestsThrottled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UnauthenticatedRequestsThrottled'", "UnauthenticatedRequestsThrottled", global::System.Management.Automation.CompletionResultType.ParameterValue, "UnauthenticatedRequestsThrottled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidHealthCheckType".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidHealthCheckType'", "InvalidHealthCheckType", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidHealthCheckType"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Forbidden".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Forbidden'", "Forbidden", global::System.Management.Automation.CompletionResultType.ParameterValue, "Forbidden"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BillingScopeIdCannotBeChanged".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingScopeIdCannotBeChanged'", "BillingScopeIdCannotBeChanged", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingScopeIdCannotBeChanged"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AppliedScopesNotAssociatedWithCommerceAccount".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AppliedScopesNotAssociatedWithCommerceAccount'", "AppliedScopesNotAssociatedWithCommerceAccount", global::System.Management.Automation.CompletionResultType.ParameterValue, "AppliedScopesNotAssociatedWithCommerceAccount"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PatchValuesSameAsExisting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PatchValuesSameAsExisting'", "PatchValuesSameAsExisting", global::System.Management.Automation.CompletionResultType.ParameterValue, "PatchValuesSameAsExisting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RoleAssignmentCreationFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RoleAssignmentCreationFailed'", "RoleAssignmentCreationFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "RoleAssignmentCreationFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReservationOrderCreationFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ReservationOrderCreationFailed'", "ReservationOrderCreationFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReservationOrderCreationFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReservationOrderNotEnabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ReservationOrderNotEnabled'", "ReservationOrderNotEnabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReservationOrderNotEnabled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CapacityUpdateScopesFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CapacityUpdateScopesFailed'", "CapacityUpdateScopesFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "CapacityUpdateScopesFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UnsupportedReservationTerm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UnsupportedReservationTerm'", "UnsupportedReservationTerm", global::System.Management.Automation.CompletionResultType.ParameterValue, "UnsupportedReservationTerm"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReservationOrderIdAlreadyExists".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ReservationOrderIdAlreadyExists'", "ReservationOrderIdAlreadyExists", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReservationOrderIdAlreadyExists"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RiskCheckFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RiskCheckFailed'", "RiskCheckFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "RiskCheckFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CreateQuoteFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CreateQuoteFailed'", "CreateQuoteFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "CreateQuoteFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ActivateQuoteFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ActivateQuoteFailed'", "ActivateQuoteFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "ActivateQuoteFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NonsupportedAccountId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NonsupportedAccountId'", "NonsupportedAccountId", global::System.Management.Automation.CompletionResultType.ParameterValue, "NonsupportedAccountId"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PaymentInstrumentNotFound".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PaymentInstrumentNotFound'", "PaymentInstrumentNotFound", global::System.Management.Automation.CompletionResultType.ParameterValue, "PaymentInstrumentNotFound"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MissingAppliedScopesForSingle".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MissingAppliedScopesForSingle'", "MissingAppliedScopesForSingle", global::System.Management.Automation.CompletionResultType.ParameterValue, "MissingAppliedScopesForSingle"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NoValidReservationsToReRate".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NoValidReservationsToReRate'", "NoValidReservationsToReRate", global::System.Management.Automation.CompletionResultType.ParameterValue, "NoValidReservationsToReRate"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ReRateOnlyAllowedForEA".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ReRateOnlyAllowedForEA'", "ReRateOnlyAllowedForEA", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReRateOnlyAllowedForEA"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "OperationCannotBePerformedInCurrentState".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'OperationCannotBePerformedInCurrentState'", "OperationCannotBePerformedInCurrentState", global::System.Management.Automation.CompletionResultType.ParameterValue, "OperationCannotBePerformedInCurrentState"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidSingleAppliedScopesCount".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidSingleAppliedScopesCount'", "InvalidSingleAppliedScopesCount", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidSingleAppliedScopesCount"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidFulfillmentRequestParameters".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidFulfillmentRequestParameters'", "InvalidFulfillmentRequestParameters", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidFulfillmentRequestParameters"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotSupportedCountry".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NotSupportedCountry'", "NotSupportedCountry", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotSupportedCountry"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "InvalidRefundQuantity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InvalidRefundQuantity'", "InvalidRefundQuantity", global::System.Management.Automation.CompletionResultType.ParameterValue, "InvalidRefundQuantity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PurchaseError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PurchaseError'", "PurchaseError", global::System.Management.Automation.CompletionResultType.ParameterValue, "PurchaseError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BillingCustomerInputError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingCustomerInputError'", "BillingCustomerInputError", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingCustomerInputError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BillingPaymentInstrumentSoftError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingPaymentInstrumentSoftError'", "BillingPaymentInstrumentSoftError", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingPaymentInstrumentSoftError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BillingPaymentInstrumentHardError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingPaymentInstrumentHardError'", "BillingPaymentInstrumentHardError", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingPaymentInstrumentHardError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BillingTransientError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingTransientError'", "BillingTransientError", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingTransientError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BillingError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingError'", "BillingError", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FulfillmentConfigurationError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FulfillmentConfigurationError'", "FulfillmentConfigurationError", global::System.Management.Automation.CompletionResultType.ParameterValue, "FulfillmentConfigurationError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FulfillmentOutOfStockError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FulfillmentOutOfStockError'", "FulfillmentOutOfStockError", global::System.Management.Automation.CompletionResultType.ParameterValue, "FulfillmentOutOfStockError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FulfillmentTransientError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FulfillmentTransientError'", "FulfillmentTransientError", global::System.Management.Automation.CompletionResultType.ParameterValue, "FulfillmentTransientError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FulfillmentError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FulfillmentError'", "FulfillmentError", global::System.Management.Automation.CompletionResultType.ParameterValue, "FulfillmentError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CalculatePriceFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CalculatePriceFailed'", "CalculatePriceFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "CalculatePriceFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AppliedScopesSameAsExisting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AppliedScopesSameAsExisting'", "AppliedScopesSameAsExisting", global::System.Management.Automation.CompletionResultType.ParameterValue, "AppliedScopesSameAsExisting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SelfServiceRefundNotSupported".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SelfServiceRefundNotSupported'", "SelfServiceRefundNotSupported", global::System.Management.Automation.CompletionResultType.ParameterValue, "SelfServiceRefundNotSupported"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RefundLimitExceeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RefundLimitExceeded'", "RefundLimitExceeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "RefundLimitExceeded"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ErrorResponseCode.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ErrorResponseCode.TypeConverter.cs deleted file mode 100644 index 224bc07977bc..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ErrorResponseCode.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - public partial class ErrorResponseCodeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => ErrorResponseCode.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ErrorResponseCode.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ErrorResponseCode.cs deleted file mode 100644 index 6815e66161a4..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ErrorResponseCode.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Error code describing the reason that service is not able to process the incoming request - /// - public partial struct ErrorResponseCode : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode ActivateQuoteFailed = @"ActivateQuoteFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode AppliedScopesNotAssociatedWithCommerceAccount = @"AppliedScopesNotAssociatedWithCommerceAccount"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode AppliedScopesSameAsExisting = @"AppliedScopesSameAsExisting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode AuthorizationFailed = @"AuthorizationFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode BadRequest = @"BadRequest"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode BillingCustomerInputError = @"BillingCustomerInputError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode BillingError = @"BillingError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode BillingPaymentInstrumentHardError = @"BillingPaymentInstrumentHardError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode BillingPaymentInstrumentSoftError = @"BillingPaymentInstrumentSoftError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode BillingScopeIdCannotBeChanged = @"BillingScopeIdCannotBeChanged"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode BillingTransientError = @"BillingTransientError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode CalculatePriceFailed = @"CalculatePriceFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode CapacityUpdateScopesFailed = @"CapacityUpdateScopesFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode ClientCertificateThumbprintNotSet = @"ClientCertificateThumbprintNotSet"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode CreateQuoteFailed = @"CreateQuoteFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode Forbidden = @"Forbidden"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode FulfillmentConfigurationError = @"FulfillmentConfigurationError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode FulfillmentError = @"FulfillmentError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode FulfillmentOutOfStockError = @"FulfillmentOutOfStockError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode FulfillmentTransientError = @"FulfillmentTransientError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode HttpMethodNotSupported = @"HttpMethodNotSupported"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InternalServerError = @"InternalServerError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidAccessToken = @"InvalidAccessToken"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidFulfillmentRequestParameters = @"InvalidFulfillmentRequestParameters"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidHealthCheckType = @"InvalidHealthCheckType"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidLocationId = @"InvalidLocationId"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidRefundQuantity = @"InvalidRefundQuantity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidRequestContent = @"InvalidRequestContent"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidRequestUri = @"InvalidRequestUri"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidReservationId = @"InvalidReservationId"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidReservationOrderId = @"InvalidReservationOrderId"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidSingleAppliedScopesCount = @"InvalidSingleAppliedScopesCount"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidSubscriptionId = @"InvalidSubscriptionId"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode InvalidTenantId = @"InvalidTenantId"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode MissingAppliedScopesForSingle = @"MissingAppliedScopesForSingle"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode MissingTenantId = @"MissingTenantId"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode NoValidReservationsToReRate = @"NoValidReservationsToReRate"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode NonsupportedAccountId = @"NonsupportedAccountId"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode NotSpecified = @"NotSpecified"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode NotSupportedCountry = @"NotSupportedCountry"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode OperationCannotBePerformedInCurrentState = @"OperationCannotBePerformedInCurrentState"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode OperationFailed = @"OperationFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode PatchValuesSameAsExisting = @"PatchValuesSameAsExisting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode PaymentInstrumentNotFound = @"PaymentInstrumentNotFound"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode PurchaseError = @"PurchaseError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode ReRateOnlyAllowedForEa = @"ReRateOnlyAllowedForEA"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode RefundLimitExceeded = @"RefundLimitExceeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode ReservationIdNotInReservationOrder = @"ReservationIdNotInReservationOrder"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode ReservationOrderCreationFailed = @"ReservationOrderCreationFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode ReservationOrderIdAlreadyExists = @"ReservationOrderIdAlreadyExists"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode ReservationOrderNotEnabled = @"ReservationOrderNotEnabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode ReservationOrderNotFound = @"ReservationOrderNotFound"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode RiskCheckFailed = @"RiskCheckFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode RoleAssignmentCreationFailed = @"RoleAssignmentCreationFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode SelfServiceRefundNotSupported = @"SelfServiceRefundNotSupported"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode ServerTimeout = @"ServerTimeout"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode UnauthenticatedRequestsThrottled = @"UnauthenticatedRequestsThrottled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode UnsupportedReservationTerm = @"UnsupportedReservationTerm"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ErrorResponseCode - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ErrorResponseCode(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ErrorResponseCode - /// 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.Reservations.Support.ErrorResponseCode e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ErrorResponseCode (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 ErrorResponseCode && Equals((ErrorResponseCode)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ErrorResponseCode(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum ErrorResponseCode - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ErrorResponseCode - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ErrorResponseCode - /// the value to convert to an instance of . - - public static implicit operator ErrorResponseCode(string value) - { - return new ErrorResponseCode(value); - } - - /// Implicit operator to convert ErrorResponseCode to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode e) - { - return e._value; - } - - /// Overriding != operator for enum ErrorResponseCode - /// 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.Reservations.Support.ErrorResponseCode e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ErrorResponseCode - /// 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.Reservations.Support.ErrorResponseCode e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ErrorResponseCode e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ExchangeOperationResultStatus.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ExchangeOperationResultStatus.Completer.cs deleted file mode 100644 index 32fdb6ae3a70..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ExchangeOperationResultStatus.Completer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Status of the operation. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatusTypeConverter))] - public partial struct ExchangeOperationResultStatus : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingRefunds".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingRefunds'", "PendingRefunds", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingRefunds"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingPurchases".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingPurchases'", "PendingPurchases", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingPurchases"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ExchangeOperationResultStatus.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ExchangeOperationResultStatus.TypeConverter.cs deleted file mode 100644 index ffce7466b091..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ExchangeOperationResultStatus.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Status of the operation. - public partial class ExchangeOperationResultStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => ExchangeOperationResultStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ExchangeOperationResultStatus.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ExchangeOperationResultStatus.cs deleted file mode 100644 index 4b3d8743c624..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ExchangeOperationResultStatus.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Status of the operation. - public partial struct ExchangeOperationResultStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus PendingPurchases = @"PendingPurchases"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus PendingRefunds = @"PendingRefunds"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ExchangeOperationResultStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ExchangeOperationResultStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ExchangeOperationResultStatus - /// 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.Reservations.Support.ExchangeOperationResultStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ExchangeOperationResultStatus (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 ExchangeOperationResultStatus && Equals((ExchangeOperationResultStatus)obj); - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private ExchangeOperationResultStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum ExchangeOperationResultStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ExchangeOperationResultStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ExchangeOperationResultStatus - /// the value to convert to an instance of . - - public static implicit operator ExchangeOperationResultStatus(string value) - { - return new ExchangeOperationResultStatus(value); - } - - /// Implicit operator to convert ExchangeOperationResultStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus e) - { - return e._value; - } - - /// Overriding != operator for enum ExchangeOperationResultStatus - /// 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.Reservations.Support.ExchangeOperationResultStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ExchangeOperationResultStatus - /// 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.Reservations.Support.ExchangeOperationResultStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ExchangeOperationResultStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/InstanceFlexibility.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/InstanceFlexibility.Completer.cs deleted file mode 100644 index 95197dab3296..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/InstanceFlexibility.Completer.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines - /// reserved resource type. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibilityTypeConverter))] - public partial struct InstanceFlexibility : - 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".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'On'", "On", global::System.Management.Automation.CompletionResultType.ParameterValue, "On"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Off".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Off'", "Off", global::System.Management.Automation.CompletionResultType.ParameterValue, "Off"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/InstanceFlexibility.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/InstanceFlexibility.TypeConverter.cs deleted file mode 100644 index bf65828435dc..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/InstanceFlexibility.TypeConverter.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines - /// reserved resource type. - /// - public partial class InstanceFlexibilityTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => InstanceFlexibility.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/InstanceFlexibility.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/InstanceFlexibility.cs deleted file mode 100644 index e0a87cc378ee..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/InstanceFlexibility.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines - /// reserved resource type. - /// - public partial struct InstanceFlexibility : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility Off = @"Off"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility On = @"On"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to InstanceFlexibility - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new InstanceFlexibility(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type InstanceFlexibility - /// 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.Reservations.Support.InstanceFlexibility e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type InstanceFlexibility (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 InstanceFlexibility && Equals((InstanceFlexibility)obj); - } - - /// Returns hashCode for enum InstanceFlexibility - /// 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 InstanceFlexibility(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for InstanceFlexibility - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to InstanceFlexibility - /// the value to convert to an instance of . - - public static implicit operator InstanceFlexibility(string value) - { - return new InstanceFlexibility(value); - } - - /// Implicit operator to convert InstanceFlexibility to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility e) - { - return e._value; - } - - /// Overriding != operator for enum InstanceFlexibility - /// 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.Reservations.Support.InstanceFlexibility e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum InstanceFlexibility - /// 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.Reservations.Support.InstanceFlexibility e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/Kind.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/Kind.Completer.cs deleted file mode 100644 index 8e0f2b83a21e..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/Kind.Completer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Resource Provider type to be reserved. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.KindTypeConverter))] - public partial struct Kind : - 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) || "Microsoft.Compute".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Microsoft.Compute'", "Microsoft.Compute", global::System.Management.Automation.CompletionResultType.ParameterValue, "Microsoft.Compute"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/Kind.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/Kind.TypeConverter.cs deleted file mode 100644 index d5d6d741069b..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/Kind.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Resource Provider type to be reserved. - public partial class KindTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => Kind.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/Kind.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/Kind.cs deleted file mode 100644 index d7903903877b..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/Kind.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Resource Provider type to be reserved. - public partial struct Kind : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind MicrosoftCompute = @"Microsoft.Compute"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Kind - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Kind(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Kind - /// 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.Reservations.Support.Kind e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Kind (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 Kind && Equals((Kind)obj); - } - - /// Returns hashCode for enum Kind - /// 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 Kind(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Kind - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Kind - /// the value to convert to an instance of . - - public static implicit operator Kind(string value) - { - return new Kind(value); - } - - /// Implicit operator to convert Kind to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind e) - { - return e._value; - } - - /// Overriding != operator for enum Kind - /// 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.Reservations.Support.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Kind - /// 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.Reservations.Support.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Kind e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/Location.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/Location.Completer.cs deleted file mode 100644 index cf0aba56ddca..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/Location.Completer.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Location in which the Resources needs to be reserved. It cannot be changed after the resource has been created. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.LocationTypeConverter))] - public partial struct Location : - 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) || "westus".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'westus'", "westus", global::System.Management.Automation.CompletionResultType.ParameterValue, "westus"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "eastus".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'eastus'", "eastus", global::System.Management.Automation.CompletionResultType.ParameterValue, "eastus"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "eastus2".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'eastus2'", "eastus2", global::System.Management.Automation.CompletionResultType.ParameterValue, "eastus2"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "northcentralus".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'northcentralus'", "northcentralus", global::System.Management.Automation.CompletionResultType.ParameterValue, "northcentralus"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "westus2".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'westus2'", "westus2", global::System.Management.Automation.CompletionResultType.ParameterValue, "westus2"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "southcentralus".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'southcentralus'", "southcentralus", global::System.Management.Automation.CompletionResultType.ParameterValue, "southcentralus"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "centralus".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'centralus'", "centralus", global::System.Management.Automation.CompletionResultType.ParameterValue, "centralus"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "westeurope".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'westeurope'", "westeurope", global::System.Management.Automation.CompletionResultType.ParameterValue, "westeurope"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "northeurope".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'northeurope'", "northeurope", global::System.Management.Automation.CompletionResultType.ParameterValue, "northeurope"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "eastasia".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'eastasia'", "eastasia", global::System.Management.Automation.CompletionResultType.ParameterValue, "eastasia"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "southeastasia".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'southeastasia'", "southeastasia", global::System.Management.Automation.CompletionResultType.ParameterValue, "southeastasia"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "japaneast".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'japaneast'", "japaneast", global::System.Management.Automation.CompletionResultType.ParameterValue, "japaneast"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "japanwest".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'japanwest'", "japanwest", global::System.Management.Automation.CompletionResultType.ParameterValue, "japanwest"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "brazilsouth".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'brazilsouth'", "brazilsouth", global::System.Management.Automation.CompletionResultType.ParameterValue, "brazilsouth"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "australiaeast".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'australiaeast'", "australiaeast", global::System.Management.Automation.CompletionResultType.ParameterValue, "australiaeast"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "australiasoutheast".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'australiasoutheast'", "australiasoutheast", global::System.Management.Automation.CompletionResultType.ParameterValue, "australiasoutheast"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "southindia".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'southindia'", "southindia", global::System.Management.Automation.CompletionResultType.ParameterValue, "southindia"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "westindia".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'westindia'", "westindia", global::System.Management.Automation.CompletionResultType.ParameterValue, "westindia"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "centralindia".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'centralindia'", "centralindia", global::System.Management.Automation.CompletionResultType.ParameterValue, "centralindia"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "canadacentral".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'canadacentral'", "canadacentral", global::System.Management.Automation.CompletionResultType.ParameterValue, "canadacentral"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "canadaeast".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'canadaeast'", "canadaeast", global::System.Management.Automation.CompletionResultType.ParameterValue, "canadaeast"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "uksouth".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'uksouth'", "uksouth", global::System.Management.Automation.CompletionResultType.ParameterValue, "uksouth"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "westcentralus".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'westcentralus'", "westcentralus", global::System.Management.Automation.CompletionResultType.ParameterValue, "westcentralus"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ukwest".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ukwest'", "ukwest", global::System.Management.Automation.CompletionResultType.ParameterValue, "ukwest"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/Location.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/Location.TypeConverter.cs deleted file mode 100644 index 30837d6571ca..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/Location.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Location in which the Resources needs to be reserved. It cannot be changed after the resource has been created. - /// - public partial class LocationTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => Location.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/Location.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/Location.cs deleted file mode 100644 index 1412de00c8de..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/Location.cs +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Location in which the Resources needs to be reserved. It cannot be changed after the resource has been created. - /// - public partial struct Location : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Australiaeast = @"australiaeast"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Australiasoutheast = @"australiasoutheast"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Brazilsouth = @"brazilsouth"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Canadacentral = @"canadacentral"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Canadaeast = @"canadaeast"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Centralindia = @"centralindia"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Centralus = @"centralus"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Eastasia = @"eastasia"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Eastus = @"eastus"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Eastus2 = @"eastus2"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Japaneast = @"japaneast"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Japanwest = @"japanwest"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Northcentralus = @"northcentralus"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Northeurope = @"northeurope"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Southcentralus = @"southcentralus"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Southeastasia = @"southeastasia"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Southindia = @"southindia"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Uksouth = @"uksouth"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Ukwest = @"ukwest"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Westcentralus = @"westcentralus"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Westeurope = @"westeurope"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Westindia = @"westindia"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Westus = @"westus"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location Westus2 = @"westus2"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Location - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Location(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Location - /// 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.Reservations.Support.Location e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Location (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 Location && Equals((Location)obj); - } - - /// Returns hashCode for enum Location - /// 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 Location(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Location - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Location - /// the value to convert to an instance of . - - public static implicit operator Location(string value) - { - return new Location(value); - } - - /// Implicit operator to convert Location to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location e) - { - return e._value; - } - - /// Overriding != operator for enum Location - /// 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.Reservations.Support.Location e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Location - /// 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.Reservations.Support.Location e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.Location e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/OperationStatus.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/OperationStatus.Completer.cs deleted file mode 100644 index 1363fb9c2048..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/OperationStatus.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Status of the individual operation. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatusTypeConverter))] - public partial struct OperationStatus : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/OperationStatus.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/OperationStatus.TypeConverter.cs deleted file mode 100644 index 30d780a31f87..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/OperationStatus.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Status of the individual operation. - public partial class OperationStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => 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) => OperationStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/OperationStatus.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/OperationStatus.cs deleted file mode 100644 index b09d59561beb..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/OperationStatus.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Status of the individual operation. - public partial struct OperationStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus Pending = @"Pending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus Succeeded = @"Succeeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to OperationStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new OperationStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type OperationStatus - /// 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.Reservations.Support.OperationStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type OperationStatus (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 OperationStatus && Equals((OperationStatus)obj); - } - - /// Returns hashCode for enum OperationStatus - /// 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 OperationStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for OperationStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to OperationStatus - /// the value to convert to an instance of . - - public static implicit operator OperationStatus(string value) - { - return new OperationStatus(value); - } - - /// Implicit operator to convert OperationStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus e) - { - return e._value; - } - - /// Overriding != operator for enum OperationStatus - /// 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.Reservations.Support.OperationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum OperationStatus - /// 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.Reservations.Support.OperationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.OperationStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/PaymentStatus.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/PaymentStatus.Completer.cs deleted file mode 100644 index bfab6890e094..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/PaymentStatus.Completer.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Describes whether the payment is completed, failed, cancelled or scheduled in the future. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatusTypeConverter))] - public partial struct PaymentStatus : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Scheduled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Scheduled'", "Scheduled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Scheduled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/PaymentStatus.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/PaymentStatus.TypeConverter.cs deleted file mode 100644 index 393da929a1d7..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/PaymentStatus.TypeConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Describes whether the payment is completed, failed, cancelled or scheduled in the future. - /// - public partial class PaymentStatusTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => PaymentStatus.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/PaymentStatus.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/PaymentStatus.cs deleted file mode 100644 index 344f5e42c44b..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/PaymentStatus.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// - /// Describes whether the payment is completed, failed, cancelled or scheduled in the future. - /// - public partial struct PaymentStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus Scheduled = @"Scheduled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus Succeeded = @"Succeeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to PaymentStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PaymentStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PaymentStatus - /// 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.Reservations.Support.PaymentStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PaymentStatus (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 PaymentStatus && Equals((PaymentStatus)obj); - } - - /// Returns hashCode for enum PaymentStatus - /// 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 PaymentStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PaymentStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PaymentStatus - /// the value to convert to an instance of . - - public static implicit operator PaymentStatus(string value) - { - return new PaymentStatus(value); - } - - /// Implicit operator to convert PaymentStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus e) - { - return e._value; - } - - /// Overriding != operator for enum PaymentStatus - /// 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.Reservations.Support.PaymentStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PaymentStatus - /// 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.Reservations.Support.PaymentStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.PaymentStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ProvisioningState.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ProvisioningState.Completer.cs deleted file mode 100644 index ccd4d7f645f2..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ProvisioningState.Completer.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the current state of the Reservation. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningStateTypeConverter))] - public partial struct ProvisioningState : - 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) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingResourceHold".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingResourceHold'", "PendingResourceHold", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingResourceHold"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConfirmedResourceHold".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ConfirmedResourceHold'", "ConfirmedResourceHold", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConfirmedResourceHold"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PendingBilling".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingBilling'", "PendingBilling", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingBilling"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ConfirmedBilling".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ConfirmedBilling'", "ConfirmedBilling", global::System.Management.Automation.CompletionResultType.ParameterValue, "ConfirmedBilling"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Created".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Created'", "Created", global::System.Management.Automation.CompletionResultType.ParameterValue, "Created"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - 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) || "BillingFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BillingFailed'", "BillingFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "BillingFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Split".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Split'", "Split", global::System.Management.Automation.CompletionResultType.ParameterValue, "Split"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Merged".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Merged'", "Merged", global::System.Management.Automation.CompletionResultType.ParameterValue, "Merged"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs deleted file mode 100644 index 7188b53b0176..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ProvisioningState.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the current state of the Reservation. - public partial class ProvisioningStateTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => ProvisioningState.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ProvisioningState.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ProvisioningState.cs deleted file mode 100644 index d3cc1dc401a4..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ProvisioningState.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the current state of the Reservation. - public partial struct ProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState BillingFailed = @"BillingFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState ConfirmedBilling = @"ConfirmedBilling"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState ConfirmedResourceHold = @"ConfirmedResourceHold"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState Created = @"Created"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState Creating = @"Creating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState Expired = @"Expired"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState Merged = @"Merged"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState PendingBilling = @"PendingBilling"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState PendingResourceHold = @"PendingResourceHold"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState Split = @"Split"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState Succeeded = @"Succeeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ProvisioningState - /// 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.Reservations.Support.ProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ProvisioningState (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 ProvisioningState && Equals((ProvisioningState)obj); - } - - /// Returns hashCode for enum ProvisioningState - /// 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 ProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ProvisioningState - /// the value to convert to an instance of . - - public static implicit operator ProvisioningState(string value) - { - return new ProvisioningState(value); - } - - /// Implicit operator to convert ProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum ProvisioningState - /// 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.Reservations.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ProvisioningState - /// 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.Reservations.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationBillingPlan.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationBillingPlan.Completer.cs deleted file mode 100644 index a82fe3add809..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationBillingPlan.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the billing plans. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlanTypeConverter))] - public partial struct ReservationBillingPlan : - 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) || "Upfront".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Upfront'", "Upfront", global::System.Management.Automation.CompletionResultType.ParameterValue, "Upfront"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Monthly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Monthly'", "Monthly", global::System.Management.Automation.CompletionResultType.ParameterValue, "Monthly"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationBillingPlan.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationBillingPlan.TypeConverter.cs deleted file mode 100644 index fa1d543793b8..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationBillingPlan.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the billing plans. - public partial class ReservationBillingPlanTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => ReservationBillingPlan.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationBillingPlan.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationBillingPlan.cs deleted file mode 100644 index 6d7696b1bfe7..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationBillingPlan.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the billing plans. - public partial struct ReservationBillingPlan : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan Monthly = @"Monthly"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan Upfront = @"Upfront"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ReservationBillingPlan - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ReservationBillingPlan(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ReservationBillingPlan - /// 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.Reservations.Support.ReservationBillingPlan e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ReservationBillingPlan (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 ReservationBillingPlan && Equals((ReservationBillingPlan)obj); - } - - /// Returns hashCode for enum ReservationBillingPlan - /// 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 ReservationBillingPlan(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ReservationBillingPlan - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ReservationBillingPlan - /// the value to convert to an instance of . - - public static implicit operator ReservationBillingPlan(string value) - { - return new ReservationBillingPlan(value); - } - - /// Implicit operator to convert ReservationBillingPlan to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan e) - { - return e._value; - } - - /// Overriding != operator for enum ReservationBillingPlan - /// 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.Reservations.Support.ReservationBillingPlan e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ReservationBillingPlan - /// 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.Reservations.Support.ReservationBillingPlan e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationStatusCode.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationStatusCode.Completer.cs deleted file mode 100644 index 943137d39ff7..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationStatusCode.Completer.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Argument completer implementation for ReservationStatusCode. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCodeTypeConverter))] - public partial struct ReservationStatusCode : - 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) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Processing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Processing'", "Processing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Processing"); - } - 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) || "PurchaseError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PurchaseError'", "PurchaseError", global::System.Management.Automation.CompletionResultType.ParameterValue, "PurchaseError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PaymentInstrumentError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PaymentInstrumentError'", "PaymentInstrumentError", global::System.Management.Automation.CompletionResultType.ParameterValue, "PaymentInstrumentError"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Split".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Split'", "Split", global::System.Management.Automation.CompletionResultType.ParameterValue, "Split"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Merged".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Merged'", "Merged", global::System.Management.Automation.CompletionResultType.ParameterValue, "Merged"); - } - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationStatusCode.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationStatusCode.TypeConverter.cs deleted file mode 100644 index 682f85889461..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationStatusCode.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// TypeConverter implementation for ReservationStatusCode. - public partial class ReservationStatusCodeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => ReservationStatusCode.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationStatusCode.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationStatusCode.cs deleted file mode 100644 index 145bc5ff7e3a..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationStatusCode.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - public partial struct ReservationStatusCode : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode Active = @"Active"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode Expired = @"Expired"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode Merged = @"Merged"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode PaymentInstrumentError = @"PaymentInstrumentError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode Pending = @"Pending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode Processing = @"Processing"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode PurchaseError = @"PurchaseError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode Split = @"Split"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode Succeeded = @"Succeeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ReservationStatusCode - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ReservationStatusCode(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ReservationStatusCode - /// 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.Reservations.Support.ReservationStatusCode e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ReservationStatusCode (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 ReservationStatusCode && Equals((ReservationStatusCode)obj); - } - - /// Returns hashCode for enum ReservationStatusCode - /// 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 ReservationStatusCode(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ReservationStatusCode - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ReservationStatusCode - /// the value to convert to an instance of . - - public static implicit operator ReservationStatusCode(string value) - { - return new ReservationStatusCode(value); - } - - /// Implicit operator to convert ReservationStatusCode to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode e) - { - return e._value; - } - - /// Overriding != operator for enum ReservationStatusCode - /// 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.Reservations.Support.ReservationStatusCode e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ReservationStatusCode - /// 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.Reservations.Support.ReservationStatusCode e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationStatusCode e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationTerm.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationTerm.Completer.cs deleted file mode 100644 index 813a26ede024..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationTerm.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the term of reservation. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTermTypeConverter))] - public partial struct ReservationTerm : - 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"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "P5Y".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'P5Y'", "P5Y", global::System.Management.Automation.CompletionResultType.ParameterValue, "P5Y"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationTerm.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationTerm.TypeConverter.cs deleted file mode 100644 index 67e8fb5f2076..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationTerm.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the term of reservation. - public partial class ReservationTermTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => ReservationTerm.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationTerm.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationTerm.cs deleted file mode 100644 index 0c02d1cc2883..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservationTerm.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent the term of reservation. - public partial struct ReservationTerm : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm P1Y = @"P1Y"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm P3Y = @"P3Y"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm P5Y = @"P5Y"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ReservationTerm - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ReservationTerm(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ReservationTerm - /// 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.Reservations.Support.ReservationTerm e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ReservationTerm (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 ReservationTerm && Equals((ReservationTerm)obj); - } - - /// Returns hashCode for enum ReservationTerm - /// 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 ReservationTerm(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ReservationTerm - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ReservationTerm - /// the value to convert to an instance of . - - public static implicit operator ReservationTerm(string value) - { - return new ReservationTerm(value); - } - - /// Implicit operator to convert ReservationTerm to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm e) - { - return e._value; - } - - /// Overriding != operator for enum ReservationTerm - /// 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.Reservations.Support.ReservationTerm e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ReservationTerm - /// 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.Reservations.Support.ReservationTerm e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservedResourceType.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservedResourceType.Completer.cs deleted file mode 100644 index fc50de70e9d6..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservedResourceType.Completer.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The type of the resource that is being reserved. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceTypeTypeConverter))] - public partial struct ReservedResourceType : - 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) || "VirtualMachines".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'VirtualMachines'", "VirtualMachines", global::System.Management.Automation.CompletionResultType.ParameterValue, "VirtualMachines"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlDatabases".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SqlDatabases'", "SqlDatabases", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlDatabases"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SuseLinux".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SuseLinux'", "SuseLinux", global::System.Management.Automation.CompletionResultType.ParameterValue, "SuseLinux"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CosmosDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CosmosDb'", "CosmosDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "CosmosDb"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RedHat".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RedHat'", "RedHat", global::System.Management.Automation.CompletionResultType.ParameterValue, "RedHat"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlDataWarehouse".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SqlDataWarehouse'", "SqlDataWarehouse", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlDataWarehouse"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "VMwareCloudSimple".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'VMwareCloudSimple'", "VMwareCloudSimple", global::System.Management.Automation.CompletionResultType.ParameterValue, "VMwareCloudSimple"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RedHatOsa".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RedHatOsa'", "RedHatOsa", global::System.Management.Automation.CompletionResultType.ParameterValue, "RedHatOsa"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Databricks".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Databricks'", "Databricks", global::System.Management.Automation.CompletionResultType.ParameterValue, "Databricks"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AppService".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AppService'", "AppService", global::System.Management.Automation.CompletionResultType.ParameterValue, "AppService"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedDisk".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ManagedDisk'", "ManagedDisk", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedDisk"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BlockBlob".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BlockBlob'", "BlockBlob", global::System.Management.Automation.CompletionResultType.ParameterValue, "BlockBlob"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RedisCache".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RedisCache'", "RedisCache", global::System.Management.Automation.CompletionResultType.ParameterValue, "RedisCache"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureDataExplorer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AzureDataExplorer'", "AzureDataExplorer", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureDataExplorer"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MySql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MySql'", "MySql", global::System.Management.Automation.CompletionResultType.ParameterValue, "MySql"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MariaDb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MariaDb'", "MariaDb", global::System.Management.Automation.CompletionResultType.ParameterValue, "MariaDb"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PostgreSql".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PostgreSql'", "PostgreSql", global::System.Management.Automation.CompletionResultType.ParameterValue, "PostgreSql"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DedicatedHost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DedicatedHost'", "DedicatedHost", global::System.Management.Automation.CompletionResultType.ParameterValue, "DedicatedHost"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SapHana".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SapHana'", "SapHana", global::System.Management.Automation.CompletionResultType.ParameterValue, "SapHana"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlAzureHybridBenefit".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SqlAzureHybridBenefit'", "SqlAzureHybridBenefit", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlAzureHybridBenefit"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AVS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AVS'", "AVS", global::System.Management.Automation.CompletionResultType.ParameterValue, "AVS"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DataFactory".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DataFactory'", "DataFactory", global::System.Management.Automation.CompletionResultType.ParameterValue, "DataFactory"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NetAppStorage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NetAppStorage'", "NetAppStorage", global::System.Management.Automation.CompletionResultType.ParameterValue, "NetAppStorage"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureFiles".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AzureFiles'", "AzureFiles", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureFiles"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SqlEdge".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SqlEdge'", "SqlEdge", global::System.Management.Automation.CompletionResultType.ParameterValue, "SqlEdge"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "VirtualMachineSoftware".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'VirtualMachineSoftware'", "VirtualMachineSoftware", global::System.Management.Automation.CompletionResultType.ParameterValue, "VirtualMachineSoftware"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservedResourceType.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservedResourceType.TypeConverter.cs deleted file mode 100644 index beceb574f32d..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservedResourceType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The type of the resource that is being reserved. - public partial class ReservedResourceTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => ReservedResourceType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservedResourceType.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservedResourceType.cs deleted file mode 100644 index b85d020ff339..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/ReservedResourceType.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The type of the resource that is being reserved. - public partial struct ReservedResourceType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType AppService = @"AppService"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType Avs = @"AVS"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType AzureDataExplorer = @"AzureDataExplorer"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType AzureFiles = @"AzureFiles"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType BlockBlob = @"BlockBlob"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType CosmosDb = @"CosmosDb"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType DataFactory = @"DataFactory"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType Databricks = @"Databricks"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType DedicatedHost = @"DedicatedHost"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType ManagedDisk = @"ManagedDisk"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType MariaDb = @"MariaDb"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType MySql = @"MySql"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType NetAppStorage = @"NetAppStorage"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType PostgreSql = @"PostgreSql"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType RedHat = @"RedHat"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType RedHatOsa = @"RedHatOsa"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType RedisCache = @"RedisCache"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType SapHana = @"SapHana"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType SqlAzureHybridBenefit = @"SqlAzureHybridBenefit"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType SqlDataWarehouse = @"SqlDataWarehouse"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType SqlDatabases = @"SqlDatabases"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType SqlEdge = @"SqlEdge"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType SuseLinux = @"SuseLinux"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType VMwareCloudSimple = @"VMwareCloudSimple"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType VirtualMachineSoftware = @"VirtualMachineSoftware"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType VirtualMachines = @"VirtualMachines"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ReservedResourceType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ReservedResourceType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ReservedResourceType - /// 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.Reservations.Support.ReservedResourceType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ReservedResourceType (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 ReservedResourceType && Equals((ReservedResourceType)obj); - } - - /// Returns hashCode for enum ReservedResourceType - /// 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 ReservedResourceType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ReservedResourceType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ReservedResourceType - /// the value to convert to an instance of . - - public static implicit operator ReservedResourceType(string value) - { - return new ReservedResourceType(value); - } - - /// Implicit operator to convert ReservedResourceType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType e) - { - return e._value; - } - - /// Overriding != operator for enum ReservedResourceType - /// 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.Reservations.Support.ReservedResourceType e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ReservedResourceType - /// 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.Reservations.Support.ReservedResourceType e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/SavingsPlanTerm.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/SavingsPlanTerm.Completer.cs deleted file mode 100644 index e8d01b5b4b3c..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/SavingsPlanTerm.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent savings plan term in ISO 8601 format. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTermTypeConverter))] - public partial struct SavingsPlanTerm : - 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/generated/Reservations/Reservations.Autorest/generated/api/Support/SavingsPlanTerm.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/SavingsPlanTerm.TypeConverter.cs deleted file mode 100644 index d9b6b94d8ff3..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/SavingsPlanTerm.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent savings plan term in ISO 8601 format. - public partial class SavingsPlanTermTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => SavingsPlanTerm.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/SavingsPlanTerm.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/SavingsPlanTerm.cs deleted file mode 100644 index 76978f82b1ea..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/SavingsPlanTerm.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// Represent savings plan term in ISO 8601 format. - public partial struct SavingsPlanTerm : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm P1Y = @"P1Y"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm P3Y = @"P3Y"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to SavingsPlanTerm - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new SavingsPlanTerm(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type SavingsPlanTerm - /// 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.Reservations.Support.SavingsPlanTerm e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type SavingsPlanTerm (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 SavingsPlanTerm && Equals((SavingsPlanTerm)obj); - } - - /// Returns hashCode for enum SavingsPlanTerm - /// 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 SavingsPlanTerm(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for SavingsPlanTerm - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to SavingsPlanTerm - /// the value to convert to an instance of . - - public static implicit operator SavingsPlanTerm(string value) - { - return new SavingsPlanTerm(value); - } - - /// Implicit operator to convert SavingsPlanTerm to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm e) - { - return e._value; - } - - /// Overriding != operator for enum SavingsPlanTerm - /// 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.Reservations.Support.SavingsPlanTerm e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum SavingsPlanTerm - /// 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.Reservations.Support.SavingsPlanTerm e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.SavingsPlanTerm e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyAppliedScopeType.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyAppliedScopeType.Completer.cs deleted file mode 100644 index eea1ab736957..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyAppliedScopeType.Completer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The applied scope type - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyAppliedScopeTypeTypeConverter))] - public partial struct UserFriendlyAppliedScopeType : - 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) || "Shared".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Shared'", "Shared", global::System.Management.Automation.CompletionResultType.ParameterValue, "Shared"); - } - 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) || "ResourceGroup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ResourceGroup'", "ResourceGroup", global::System.Management.Automation.CompletionResultType.ParameterValue, "ResourceGroup"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagementGroup".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ManagementGroup'", "ManagementGroup", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagementGroup"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyAppliedScopeType.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyAppliedScopeType.TypeConverter.cs deleted file mode 100644 index d4907edd6c16..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyAppliedScopeType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The applied scope type - public partial class UserFriendlyAppliedScopeTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => UserFriendlyAppliedScopeType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyAppliedScopeType.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyAppliedScopeType.cs deleted file mode 100644 index 53f45bf2502a..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyAppliedScopeType.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The applied scope type - public partial struct UserFriendlyAppliedScopeType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyAppliedScopeType ManagementGroup = @"ManagementGroup"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyAppliedScopeType None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyAppliedScopeType ResourceGroup = @"ResourceGroup"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyAppliedScopeType Shared = @"Shared"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyAppliedScopeType Single = @"Single"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to UserFriendlyAppliedScopeType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new UserFriendlyAppliedScopeType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type UserFriendlyAppliedScopeType - /// 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.Reservations.Support.UserFriendlyAppliedScopeType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type UserFriendlyAppliedScopeType (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 UserFriendlyAppliedScopeType && Equals((UserFriendlyAppliedScopeType)obj); - } - - /// Returns hashCode for enum UserFriendlyAppliedScopeType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for UserFriendlyAppliedScopeType - /// 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 UserFriendlyAppliedScopeType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to UserFriendlyAppliedScopeType - /// the value to convert to an instance of . - - public static implicit operator UserFriendlyAppliedScopeType(string value) - { - return new UserFriendlyAppliedScopeType(value); - } - - /// Implicit operator to convert UserFriendlyAppliedScopeType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyAppliedScopeType e) - { - return e._value; - } - - /// Overriding != operator for enum UserFriendlyAppliedScopeType - /// 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.Reservations.Support.UserFriendlyAppliedScopeType e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyAppliedScopeType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum UserFriendlyAppliedScopeType - /// 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.Reservations.Support.UserFriendlyAppliedScopeType e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyAppliedScopeType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyRenewState.Completer.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyRenewState.Completer.cs deleted file mode 100644 index ba6dc0ad5eee..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyRenewState.Completer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The renew state of the reservation - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyRenewStateTypeConverter))] - public partial struct UserFriendlyRenewState : - 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".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'On'", "On", global::System.Management.Automation.CompletionResultType.ParameterValue, "On"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Off".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Off'", "Off", global::System.Management.Automation.CompletionResultType.ParameterValue, "Off"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Renewed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Renewed'", "Renewed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Renewed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotRenewed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NotRenewed'", "NotRenewed", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotRenewed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotApplicable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NotApplicable'", "NotApplicable", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotApplicable"); - } - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyRenewState.TypeConverter.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyRenewState.TypeConverter.cs deleted file mode 100644 index a4e874bbee5e..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyRenewState.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The renew state of the reservation - public partial class UserFriendlyRenewStateTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => UserFriendlyRenewState.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyRenewState.cs b/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyRenewState.cs deleted file mode 100644 index 2150e4429193..000000000000 --- a/generated/Reservations/Reservations.Autorest/generated/api/Support/UserFriendlyRenewState.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support -{ - - /// The renew state of the reservation - public partial struct UserFriendlyRenewState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyRenewState NotApplicable = @"NotApplicable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyRenewState NotRenewed = @"NotRenewed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyRenewState Off = @"Off"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyRenewState On = @"On"; - - public static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyRenewState Renewed = @"Renewed"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to UserFriendlyRenewState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new UserFriendlyRenewState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type UserFriendlyRenewState - /// 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.Reservations.Support.UserFriendlyRenewState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type UserFriendlyRenewState (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 UserFriendlyRenewState && Equals((UserFriendlyRenewState)obj); - } - - /// Returns hashCode for enum UserFriendlyRenewState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for UserFriendlyRenewState - /// 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 UserFriendlyRenewState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to UserFriendlyRenewState - /// the value to convert to an instance of . - - public static implicit operator UserFriendlyRenewState(string value) - { - return new UserFriendlyRenewState(value); - } - - /// Implicit operator to convert UserFriendlyRenewState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyRenewState e) - { - return e._value; - } - - /// Overriding != operator for enum UserFriendlyRenewState - /// 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.Reservations.Support.UserFriendlyRenewState e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyRenewState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum UserFriendlyRenewState - /// 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.Reservations.Support.UserFriendlyRenewState e1, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.UserFriendlyRenewState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableExpanded.cs index 7f2d048a06cf..e18f4884d062 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Check whether the scopes from request is valid for `Reservation`.\n @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] AvailableScopes=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationAvailableScope_AvailableExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Check whether the scopes from request is valid for `Reservation`.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes", ApiVersion = "2022-11-01")] public partial class GetAzReservationAvailableScope_AvailableExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +33,25 @@ public partial class GetAzReservationAvailableScope_AvailableExpanded : global:: private string __processRecordId; /// Available scope - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AvailableScopeRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AvailableScopeRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -47,6 +62,9 @@ public partial class GetAzReservationAvailableScope_AvailableExpanded : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class GetAzReservationAvailableScope_AvailableExpanded : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -94,7 +115,7 @@ public partial class GetAzReservationAvailableScope_AvailableExpanded : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -150,31 +171,31 @@ public partial class GetAzReservationAvailableScope_AvailableExpanded : global:: Description = @".", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - public string[] Scope { get => _body.Scope ?? null /* arrayOf */; set => _body.Scope = value; } + public string[] Scope { get => _body.Scope?.ToArray() ?? null /* fixedArrayOf */; set => _body.Scope = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// 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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -220,6 +241,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.GetAzReservationA /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -241,7 +267,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationAvailableScope_AvailableExpanded() { @@ -292,11 +318,36 @@ public GetAzReservationAvailableScope_AvailableExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -308,10 +359,26 @@ public GetAzReservationAvailableScope_AvailableExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -379,7 +446,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -397,7 +464,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.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,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,ReservationId=ReservationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,12 +502,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -457,15 +524,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, ReservationId=ReservationId, body=_body }) + 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 } }); @@ -475,12 +542,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -492,8 +559,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties - WriteObject((await response).Scope); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaIdentityExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaIdentityExpanded.cs index dce8fbee4efa..63a1752d9fa5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaIdentityExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Check whether the scopes from request is valid for `Reservation`.\n @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] AvailableScopes=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationAvailableScope_AvailableViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Check whether the scopes from request is valid for `Reservation`.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes", ApiVersion = "2022-11-01")] public partial class GetAzReservationAvailableScope_AvailableViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +33,25 @@ public partial class GetAzReservationAvailableScope_AvailableViaIdentityExpanded private string __processRecordId; /// Available scope - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.AvailableScopeRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AvailableScopeRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -47,6 +62,9 @@ public partial class GetAzReservationAvailableScope_AvailableViaIdentityExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class GetAzReservationAvailableScope_AvailableViaIdentityExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -102,7 +123,7 @@ public partial class GetAzReservationAvailableScope_AvailableViaIdentityExpanded /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -130,31 +151,31 @@ public partial class GetAzReservationAvailableScope_AvailableViaIdentityExpanded Description = @".", SerializedName = @"scopes", PossibleTypes = new [] { typeof(string) })] - public string[] Scope { get => _body.Scope ?? null /* arrayOf */; set => _body.Scope = value; } + public string[] Scope { get => _body.Scope?.ToArray() ?? null /* fixedArrayOf */; set => _body.Scope = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// 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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -200,6 +221,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.GetAzReservationA /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -221,7 +247,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationAvailableScope_AvailableViaIdentityExpanded() { @@ -272,11 +298,36 @@ public GetAzReservationAvailableScope_AvailableViaIdentityExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -288,10 +339,26 @@ public GetAzReservationAvailableScope_AvailableViaIdentityExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -359,7 +426,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -393,7 +460,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + 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 } }); @@ -431,12 +498,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -453,15 +520,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + 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 } }); @@ -471,12 +538,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -488,8 +555,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties - WriteObject((await response).Scope); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded.cs new file mode 100644 index 000000000000..e0ccf690d83f --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded.cs @@ -0,0 +1,594 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; + using System; + + /// Check whether the scopes from request is valid for `Reservation`.\n + /// + /// [OpenAPI] AvailableScopes=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Check whether the scopes from request is valid for `Reservation`.\n")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes", ApiVersion = "2022-11-01")] + public partial class GetAzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// Available scope + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.AvailableScopeRequest(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _reservationId; + + /// Id of the reservation item + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the reservation item")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the reservation item", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public string ReservationId { get => this._reservationId; set => this._reservationId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _reservationOrderInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity ReservationOrderInputObject { get => this._reservationOrderInputObject; set => this._reservationOrderInputObject = value; } + + /// . + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"scopes", + PossibleTypes = new [] { typeof(string) })] + public string[] Scope { get => _body.Scope?.ToArray() ?? null /* fixedArrayOf */; set => _body.Scope = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// 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.Reservations.Models.IError + /// 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.Reservations.Models.IAvailableScopeProperties + /// 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.Reservations.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of GetAzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.GetAzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded Clone() + { + var clone = new GetAzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._body = this._body; + clone.ReservationId = this.ReservationId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded() + { + + } + + /// 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.Reservations.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.Reservations.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ReservationAvailableScopes' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ReservationOrderInputObject?.Id != null) + { + this.ReservationOrderInputObject.Id += $"/reservations/{(global::System.Uri.EscapeDataString(this.ReservationId.ToString()))}"; + await this.Client.ReservationAvailableScopesViaIdentity(ReservationOrderInputObject.Id, _body, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ReservationOrderInputObject.ReservationOrderId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ReservationOrderInputObject has null value for ReservationOrderInputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ReservationOrderInputObject) ); + } + await this.Client.ReservationAvailableScopes(ReservationOrderInputObject.ReservationOrderId ?? null, ReservationId, _body, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationId=ReservationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError + /// 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.Reservations.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.Reservations.Models.IAvailableScopeProperties + /// 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.Reservations.Models.IAvailableScopeProperties + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaJsonFilePath.cs similarity index 76% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaIdentity.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaJsonFilePath.cs index d7168cee72c6..3d870d60cfc2 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaJsonFilePath.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Check whether the scopes from request is valid for `Reservation`.\n /// /// [OpenAPI] AvailableScopes=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationAvailableScope_AvailableViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationAvailableScope_AvailableViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Check whether the scopes from request is valid for `Reservation`.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes", ApiVersion = "2022-11-01")] - public partial class GetAzReservationAvailableScope_AvailableViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class GetAzReservationAvailableScope_AvailableViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,33 @@ public partial class GetAzReservationAvailableScope_AvailableViaIdentity : globa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest _body; - - /// Available scope - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Available scope", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Available scope", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -70,6 +78,9 @@ public partial class GetAzReservationAvailableScope_AvailableViaIdentity : globa [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -82,17 +93,22 @@ public partial class GetAzReservationAvailableScope_AvailableViaIdentity : globa [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity 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 string _jsonFilePath; + + /// Path of Json file supplied to the Available operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Available operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Available operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -112,7 +128,7 @@ public partial class GetAzReservationAvailableScope_AvailableViaIdentity : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -130,29 +146,57 @@ public partial class GetAzReservationAvailableScope_AvailableViaIdentity : globa [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// Backing field for property. + private string _reservationId; + + /// Id of the reservation item + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the reservation item")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the reservation item", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -173,10 +217,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of GetAzReservationAvailableScope_AvailableViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.GetAzReservationAvailableScope_AvailableViaIdentity Clone() + /// a duplicate instance of GetAzReservationAvailableScope_AvailableViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.GetAzReservationAvailableScope_AvailableViaJsonFilePath Clone() { - var clone = new GetAzReservationAvailableScope_AvailableViaIdentity(); + var clone = new GetAzReservationAvailableScope_AvailableViaJsonFilePath(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -189,13 +233,20 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.GetAzReservationA clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.Body = this.Body; + clone.ReservationOrderId = this.ReservationOrderId; + clone.ReservationId = this.ReservationId; + clone.JsonFilePath = this.JsonFilePath; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -217,9 +268,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public GetAzReservationAvailableScope_AvailableViaIdentity() + public GetAzReservationAvailableScope_AvailableViaJsonFilePath() { } @@ -268,11 +319,36 @@ public GetAzReservationAvailableScope_AvailableViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -284,10 +360,26 @@ public GetAzReservationAvailableScope_AvailableViaIdentity() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -355,7 +447,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -368,28 +460,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.ReservationAvailableScopesViaIdentity(InputObject.Id, Body, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.ReservationOrderId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.ReservationId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ReservationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.ReservationAvailableScopes(InputObject.ReservationOrderId ?? null, InputObject.ReservationId ?? null, Body, onOk, onDefault, this, Pipeline); - } + await this.Client.ReservationAvailableScopesViaJsonString(ReservationOrderId, ReservationId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,ReservationId=ReservationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -427,12 +503,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -449,15 +525,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + 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 } }); @@ -467,12 +543,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -484,8 +560,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties - WriteObject((await response).Scope); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_Available.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaJsonString.cs similarity index 80% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_Available.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaJsonString.cs index 1b343873596c..1c54ce9cdd8e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_Available.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationAvailableScope_AvailableViaJsonString.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Check whether the scopes from request is valid for `Reservation`.\n /// /// [OpenAPI] AvailableScopes=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationAvailableScope_Available", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationAvailableScope_AvailableViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Check whether the scopes from request is valid for `Reservation`.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/availableScopes", ApiVersion = "2022-11-01")] - public partial class GetAzReservationAvailableScope_Available : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class GetAzReservationAvailableScope_AvailableViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,31 @@ public partial class GetAzReservationAvailableScope_Available : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest _body; - - /// Available scope - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Available scope", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Available scope", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -70,6 +76,9 @@ public partial class GetAzReservationAvailableScope_Available : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,6 +94,19 @@ public partial class GetAzReservationAvailableScope_Available : global::System.M /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Available operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Available operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Available operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -104,7 +126,7 @@ public partial class GetAzReservationAvailableScope_Available : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -155,24 +177,24 @@ public partial class GetAzReservationAvailableScope_Available : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -193,10 +215,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of GetAzReservationAvailableScope_Available - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.GetAzReservationAvailableScope_Available Clone() + /// a duplicate instance of GetAzReservationAvailableScope_AvailableViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.GetAzReservationAvailableScope_AvailableViaJsonString Clone() { - var clone = new GetAzReservationAvailableScope_Available(); + var clone = new GetAzReservationAvailableScope_AvailableViaJsonString(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -211,13 +233,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.GetAzReservationA clone.HttpPipelineAppend = this.HttpPipelineAppend; clone.ReservationOrderId = this.ReservationOrderId; clone.ReservationId = this.ReservationId; - clone.Body = this.Body; + clone.JsonString = this.JsonString; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -239,9 +266,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public GetAzReservationAvailableScope_Available() + public GetAzReservationAvailableScope_AvailableViaJsonString() { } @@ -290,11 +317,36 @@ public GetAzReservationAvailableScope_Available() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -306,10 +358,26 @@ public GetAzReservationAvailableScope_Available() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -377,7 +445,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -390,12 +458,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ReservationAvailableScopes(ReservationOrderId, ReservationId, Body, onOk, onDefault, this, Pipeline); + await this.Client.ReservationAvailableScopesViaJsonString(ReservationOrderId, ReservationId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.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,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,ReservationId=ReservationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -433,12 +501,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -455,15 +523,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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, body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, ReservationId=ReservationId, body=Body }) + 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 } }); @@ -473,12 +541,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -490,8 +558,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeProperties - WriteObject((await response).Scope); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationCatalog_Get.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationCatalog_Get.cs index 82b52a9a48c2..c7d6f5d0d6bf 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationCatalog_Get.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationCatalog_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] GetCatalog=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationCatalog_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Get the regions and skus that are available for RI purchase for the specified Azure subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs", ApiVersion = "2022-11-01")] public partial class GetAzReservationCatalog_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,17 +39,32 @@ public partial class GetAzReservationCatalog_Get : global::System.Management.Aut /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class GetAzReservationCatalog_Get : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -132,7 +153,7 @@ public partial class GetAzReservationCatalog_Get : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _planId; @@ -220,7 +241,8 @@ public partial class GetAzReservationCatalog_Get : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -243,24 +265,24 @@ public partial class GetAzReservationCatalog_Get : global::System.Management.Aut /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -283,6 +305,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -304,7 +331,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationCatalog_Get() { @@ -355,8 +382,33 @@ public GetAzReservationCatalog_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -409,7 +461,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -430,7 +482,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ReservedResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ReservedResourceType") ? ReservedResourceType : null,Location=this.InvocationInformation.BoundParameters.ContainsKey("Location") ? Location : null,PublisherId=this.InvocationInformation.BoundParameters.ContainsKey("PublisherId") ? PublisherId : null,OfferId=this.InvocationInformation.BoundParameters.ContainsKey("OfferId") ? OfferId : null,PlanId=this.InvocationInformation.BoundParameters.ContainsKey("PlanId") ? PlanId : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Skip=this.InvocationInformation.BoundParameters.ContainsKey("Skip") ? Skip : default(float?),Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?)}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ReservedResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ReservedResourceType") ? ReservedResourceType : null,Location=this.InvocationInformation.BoundParameters.ContainsKey("Location") ? Location : null,PublisherId=this.InvocationInformation.BoundParameters.ContainsKey("PublisherId") ? PublisherId : null,OfferId=this.InvocationInformation.BoundParameters.ContainsKey("OfferId") ? OfferId : null,PlanId=this.InvocationInformation.BoundParameters.ContainsKey("PlanId") ? PlanId : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Skip=this.InvocationInformation.BoundParameters.ContainsKey("Skip") ? Skip : default(float?),Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?)}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -468,12 +520,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -490,15 +542,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ReservedResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ReservedResourceType") ? ReservedResourceType : null, Location=this.InvocationInformation.BoundParameters.ContainsKey("Location") ? Location : null, PublisherId=this.InvocationInformation.BoundParameters.ContainsKey("PublisherId") ? PublisherId : null, OfferId=this.InvocationInformation.BoundParameters.ContainsKey("OfferId") ? OfferId : null, PlanId=this.InvocationInformation.BoundParameters.ContainsKey("PlanId") ? PlanId : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Skip=this.InvocationInformation.BoundParameters.ContainsKey("Skip") ? Skip : default(float?), Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?) }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { SubscriptionId=SubscriptionId, ReservedResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ReservedResourceType") ? ReservedResourceType : null, Location=this.InvocationInformation.BoundParameters.ContainsKey("Location") ? Location : null, PublisherId=this.InvocationInformation.BoundParameters.ContainsKey("PublisherId") ? PublisherId : null, OfferId=this.InvocationInformation.BoundParameters.ContainsKey("OfferId") ? OfferId : null, PlanId=this.InvocationInformation.BoundParameters.ContainsKey("PlanId") ? PlanId : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Skip=this.InvocationInformation.BoundParameters.ContainsKey("Skip") ? Skip : default(float?), Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?) }) + 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 } }); @@ -508,12 +560,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -525,15 +577,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationCatalog_GetViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationCatalog_GetViaIdentity.cs index a16581c880d2..7ad010a0cbdf 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationCatalog_GetViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationCatalog_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] GetCatalog=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationCatalog_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalog))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalog))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Get the regions and skus that are available for RI purchase for the specified Azure subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/catalogs", ApiVersion = "2022-11-01")] public partial class GetAzReservationCatalog_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,17 +39,32 @@ public partial class GetAzReservationCatalog_GetViaIdentity : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class GetAzReservationCatalog_GetViaIdentity : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -140,7 +161,7 @@ public partial class GetAzReservationCatalog_GetViaIdentity : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _planId; @@ -233,24 +254,24 @@ public partial class GetAzReservationCatalog_GetViaIdentity : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -273,6 +294,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -294,7 +320,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationCatalog_GetViaIdentity() { @@ -345,8 +371,33 @@ public GetAzReservationCatalog_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -399,7 +450,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -429,7 +480,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservedResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ReservedResourceType") ? ReservedResourceType : null,Location=this.InvocationInformation.BoundParameters.ContainsKey("Location") ? Location : null,PublisherId=this.InvocationInformation.BoundParameters.ContainsKey("PublisherId") ? PublisherId : null,OfferId=this.InvocationInformation.BoundParameters.ContainsKey("OfferId") ? OfferId : null,PlanId=this.InvocationInformation.BoundParameters.ContainsKey("PlanId") ? PlanId : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Skip=this.InvocationInformation.BoundParameters.ContainsKey("Skip") ? Skip : default(float?),Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?)}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservedResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ReservedResourceType") ? ReservedResourceType : null,Location=this.InvocationInformation.BoundParameters.ContainsKey("Location") ? Location : null,PublisherId=this.InvocationInformation.BoundParameters.ContainsKey("PublisherId") ? PublisherId : null,OfferId=this.InvocationInformation.BoundParameters.ContainsKey("OfferId") ? OfferId : null,PlanId=this.InvocationInformation.BoundParameters.ContainsKey("PlanId") ? PlanId : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Skip=this.InvocationInformation.BoundParameters.ContainsKey("Skip") ? Skip : default(float?),Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?)}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -467,12 +518,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -489,15 +540,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservedResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ReservedResourceType") ? ReservedResourceType : null, Location=this.InvocationInformation.BoundParameters.ContainsKey("Location") ? Location : null, PublisherId=this.InvocationInformation.BoundParameters.ContainsKey("PublisherId") ? PublisherId : null, OfferId=this.InvocationInformation.BoundParameters.ContainsKey("OfferId") ? OfferId : null, PlanId=this.InvocationInformation.BoundParameters.ContainsKey("PlanId") ? PlanId : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Skip=this.InvocationInformation.BoundParameters.ContainsKey("Skip") ? Skip : default(float?), Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?) }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservedResourceType=this.InvocationInformation.BoundParameters.ContainsKey("ReservedResourceType") ? ReservedResourceType : null, Location=this.InvocationInformation.BoundParameters.ContainsKey("Location") ? Location : null, PublisherId=this.InvocationInformation.BoundParameters.ContainsKey("PublisherId") ? PublisherId : null, OfferId=this.InvocationInformation.BoundParameters.ContainsKey("OfferId") ? OfferId : null, PlanId=this.InvocationInformation.BoundParameters.ContainsKey("PlanId") ? PlanId : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Skip=this.InvocationInformation.BoundParameters.ContainsKey("Skip") ? Skip : default(float?), Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?) }) + 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 } }); @@ -507,12 +558,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICatalogsResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -524,15 +575,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICatalogsResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationHistory_List.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationHistory_List.cs index 2383a7f6f2eb..312bdbc9dc1d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationHistory_List.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationHistory_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// List of all the revisions for the `Reservation`. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] ListRevisions=>GET:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/revisions" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationHistory_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"List of all the revisions for the `Reservation`.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/revisions", ApiVersion = "2022-11-01")] public partial class GetAzReservationHistory_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzReservationHistory_List : global::System.Management.Au /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzReservationHistory_List : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -84,7 +105,7 @@ public partial class GetAzReservationHistory_List : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -135,24 +156,24 @@ public partial class GetAzReservationHistory_List : global::System.Management.Au /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -175,6 +196,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -196,7 +222,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationHistory_List() { @@ -247,8 +273,33 @@ public GetAzReservationHistory_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +352,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,ReservationId=ReservationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -357,12 +408,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -379,15 +430,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, ReservationId=ReservationId }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -397,12 +448,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -414,15 +465,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrderId_Get.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrderId_Get.cs index f50d63d80326..77c9b997e69e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrderId_Get.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrderId_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] GetAppliedReservationList=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationOrderId_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations", ApiVersion = "2022-11-01")] public partial class GetAzReservationOrderId_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +39,26 @@ public partial class GetAzReservationOrderId_Get : global::System.Management.Aut /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -54,6 +72,9 @@ public partial class GetAzReservationOrderId_Get : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -80,7 +101,7 @@ public partial class GetAzReservationOrderId_Get : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -112,7 +133,8 @@ public partial class GetAzReservationOrderId_Get : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -121,24 +143,24 @@ public partial class GetAzReservationOrderId_Get : global::System.Management.Aut /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -161,6 +183,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -182,7 +209,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationOrderId_Get() { @@ -233,8 +260,33 @@ public GetAzReservationOrderId_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -287,7 +339,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -308,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -346,12 +398,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -368,15 +420,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { SubscriptionId=SubscriptionId }) + 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 } }); @@ -386,12 +438,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -403,8 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrderId_GetViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrderId_GetViaIdentity.cs index 94c17db2b92e..d311509bbb04 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrderId_GetViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrderId_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] GetAppliedReservationList=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationOrderId_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Get applicable `Reservation`s that are applied to this subscription or a resource group under this subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/appliedReservations", ApiVersion = "2022-11-01")] public partial class GetAzReservationOrderId_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,11 +39,26 @@ public partial class GetAzReservationOrderId_GetViaIdentity : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -54,6 +72,9 @@ public partial class GetAzReservationOrderId_GetViaIdentity : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -88,7 +109,7 @@ public partial class GetAzReservationOrderId_GetViaIdentity : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -111,24 +132,24 @@ public partial class GetAzReservationOrderId_GetViaIdentity : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -151,6 +172,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -172,7 +198,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationOrderId_GetViaIdentity() { @@ -223,8 +249,33 @@ public GetAzReservationOrderId_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -277,7 +328,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -307,7 +358,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +396,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -367,7 +418,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 } @@ -385,12 +436,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -402,8 +453,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAppliedReservations - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAppliedReservations + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_Get.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_Get.cs index 7e96215db0b3..a9c39f1afac5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_Get.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Get the details of the `ReservationOrder`. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Get=>GET:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationOrder_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Get the details of the `ReservationOrder`.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}", ApiVersion = "2022-11-01")] public partial class GetAzReservationOrder_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzReservationOrder_Get : global::System.Management.Autom /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -66,6 +84,9 @@ public partial class GetAzReservationOrder_Get : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Query)] public string Expand { get => this._expand; set => this._expand = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -107,7 +128,7 @@ public partial class GetAzReservationOrder_Get : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -130,24 +151,24 @@ public partial class GetAzReservationOrder_Get : global::System.Management.Autom /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -170,6 +191,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -191,7 +217,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationOrder_Get() { @@ -242,8 +268,33 @@ public GetAzReservationOrder_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +347,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +365,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -352,12 +403,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -374,15 +425,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { Id=Id, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -392,12 +443,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -409,8 +460,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_GetViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_GetViaIdentity.cs index 0d94b05444a2..2504ed2aef85 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_GetViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Get the details of the `ReservationOrder`. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Get=>GET:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationOrder_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Get the details of the `ReservationOrder`.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}", ApiVersion = "2022-11-01")] public partial class GetAzReservationOrder_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzReservationOrder_GetViaIdentity : global::System.Manag /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -66,6 +84,9 @@ public partial class GetAzReservationOrder_GetViaIdentity : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Query)] public string Expand { get => this._expand; set => this._expand = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class GetAzReservationOrder_GetViaIdentity : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -123,24 +144,24 @@ public partial class GetAzReservationOrder_GetViaIdentity : global::System.Manag /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -163,6 +184,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -184,7 +210,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationOrder_GetViaIdentity() { @@ -235,8 +261,33 @@ public GetAzReservationOrder_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -289,7 +340,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -319,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -357,12 +408,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -379,15 +430,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -397,12 +448,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -414,8 +465,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_List.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_List.cs index 7d1300fcbc04..833687e2c14d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_List.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationOrder_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] List=>GET:"/providers/Microsoft.Capacity/reservationOrders" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationOrder_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"List of all the `ReservationOrder`s that the user has access to in the current tenant.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders", ApiVersion = "2022-11-01")] public partial class GetAzReservationOrder_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,17 +39,32 @@ public partial class GetAzReservationOrder_List : global::System.Management.Auto /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class GetAzReservationOrder_List : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,7 +107,7 @@ public partial class GetAzReservationOrder_List : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -109,24 +130,24 @@ public partial class GetAzReservationOrder_List : global::System.Management.Auto /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -149,6 +170,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -170,7 +196,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationOrder_List() { @@ -221,8 +247,33 @@ public GetAzReservationOrder_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +326,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -293,7 +344,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -331,12 +382,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -353,7 +404,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 } @@ -371,12 +422,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -388,15 +439,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderList + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_CalculateExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_CalculateExpanded.cs index 3ad109fc2812..a6a456384058 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_CalculateExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_CalculateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Calculate price for placing a `ReservationOrder`. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Calculate=>POST:"/providers/Microsoft.Capacity/calculatePrice" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationQuote_CalculateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Calculate price for placing a `ReservationOrder`.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/calculatePrice", ApiVersion = "2022-11-01")] public partial class GetAzReservationQuote_CalculateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +33,25 @@ public partial class GetAzReservationQuote_CalculateExpanded : global::System.Ma private string __processRecordId; /// The request for reservation purchase - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. @@ -50,7 +65,7 @@ public partial class GetAzReservationQuote_CalculateExpanded : global::System.Ma Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - public string[] AppliedScope { get => _body.AppliedScopes ?? null /* arrayOf */; set => _body.AppliedScopes = value; } + public string[] AppliedScope { get => _body.AppliedScopes?.ToArray() ?? null /* fixedArrayOf */; set => _body.AppliedScopes = (value != null ? new System.Collections.Generic.List(value) : null); } /// Display name [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name")] @@ -117,9 +132,9 @@ public partial class GetAzReservationQuote_CalculateExpanded : global::System.Ma ReadOnly = false, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType AppliedScopeType { get => _body.AppliedScopeType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); set => _body.AppliedScopeType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + public string AppliedScopeType { get => _body.AppliedScopeType ?? null; set => _body.AppliedScopeType = value; } /// Represent the billing plans. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Represent the billing plans.")] @@ -129,9 +144,9 @@ public partial class GetAzReservationQuote_CalculateExpanded : global::System.Ma ReadOnly = false, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan BillingPlan { get => _body.BillingPlan ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); set => _body.BillingPlan = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + public string BillingPlan { get => _body.BillingPlan ?? null; set => _body.BillingPlan = value; } /// Subscription that will be charged for purchasing reservation or savings plan [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Subscription that will be charged for purchasing reservation or savings plan")] @@ -149,6 +164,9 @@ public partial class GetAzReservationQuote_CalculateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -173,6 +191,9 @@ public partial class GetAzReservationQuote_CalculateExpanded : global::System.Ma PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _body.DisplayName ?? null; set => _body.DisplayName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -196,9 +217,9 @@ public partial class GetAzReservationQuote_CalculateExpanded : global::System.Ma ReadOnly = false, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility InstanceFlexibility { get => _body.InstanceFlexibility ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); set => _body.InstanceFlexibility = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + public string InstanceFlexibility { get => _body.InstanceFlexibility ?? null; set => _body.InstanceFlexibility = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -225,7 +246,7 @@ public partial class GetAzReservationQuote_CalculateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -275,9 +296,9 @@ public partial class GetAzReservationQuote_CalculateExpanded : global::System.Ma ReadOnly = false, Description = @"The type of the resource that is being reserved.", SerializedName = @"reservedResourceType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType ReservedResourceType { get => _body.ReservedResourceType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType)""); set => _body.ReservedResourceType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + public string ReservedResourceType { get => _body.ReservedResourceType ?? null; set => _body.ReservedResourceType = value; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is the date-time when the Azure hybrid benefit needs to be reviewed.")] @@ -309,33 +330,33 @@ public partial class GetAzReservationQuote_CalculateExpanded : global::System.Ma ReadOnly = false, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm Term { get => _body.Term ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm)""); set => _body.Term = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + public string Term { get => _body.Term ?? null; set => _body.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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -358,6 +379,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -379,7 +405,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationQuote_CalculateExpanded() { @@ -430,8 +456,33 @@ public GetAzReservationQuote_CalculateExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -487,7 +538,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -505,7 +556,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + 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 } }); @@ -543,12 +594,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -565,15 +616,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + 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 } }); @@ -583,12 +634,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -600,8 +651,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_CalculateViaJsonFilePath.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaIdentity.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_CalculateViaJsonFilePath.cs index 4ba35d9f0fdf..ad9474d996ee 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_CalculateViaJsonFilePath.cs @@ -6,21 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; - /// - /// Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id - /// + /// Calculate price for placing a `ReservationOrder`. /// - /// [OpenAPI] ChangeDirectory=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory" + /// [OpenAPI] Calculate=>POST:"/providers/Microsoft.Capacity/calculatePrice" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Move, @"AzReservationDirectory_ChangeViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationQuote_CalculateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Calculate price for placing a `ReservationOrder`.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory", ApiVersion = "2022-11-01")] - public partial class MoveAzReservationDirectory_ChangeViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/calculatePrice", ApiVersion = "2022-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class GetAzReservationQuote_CalculateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,24 +38,28 @@ public partial class MoveAzReservationDirectory_ChangeViaIdentity : global::Syst /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest _body; + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// Request body for change directory of a reservation. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request body for change directory of a reservation.", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Request body for change directory of a reservation.", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest Body { get => this._body; set => this._body = value; } + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -67,6 +73,9 @@ public partial class MoveAzReservationDirectory_ChangeViaIdentity : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -79,17 +88,22 @@ public partial class MoveAzReservationDirectory_ChangeViaIdentity : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity 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 string _jsonFilePath; + + /// Path of Json file supplied to the Calculate operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Calculate operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Calculate operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -101,7 +115,7 @@ public partial class MoveAzReservationDirectory_ChangeViaIdentity : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -124,24 +138,24 @@ public partial class MoveAzReservationDirectory_ChangeViaIdentity : global::Syst /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -164,6 +178,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -184,6 +203,14 @@ protected override void EndProcessing() } } + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzReservationQuote_CalculateViaJsonFilePath() + { + + } + /// 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 @@ -228,8 +255,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -238,14 +290,6 @@ protected override void EndProcessing() } } - /// - /// Intializes a new instance of the cmdlet class. - /// - public MoveAzReservationDirectory_ChangeViaIdentity() - { - - } - /// Performs execution of the command. protected override void ProcessRecord() { @@ -254,7 +298,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'ReservationOrderChangeDirectory' operation")) + if (ShouldProcess($"Call remote 'ReservationOrderCalculate' operation")) { using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) { @@ -293,7 +337,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -306,24 +350,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.ReservationOrderChangeDirectoryViaIdentity(InputObject.Id, Body, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.ReservationOrderId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.ReservationOrderChangeDirectory(InputObject.ReservationOrderId ?? null, Body, onOk, onDefault, this, Pipeline); - } + await this.Client.ReservationOrderCalculateViaJsonString(_jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + 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 } }); @@ -361,12 +393,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -383,15 +415,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + 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 } }); @@ -401,12 +433,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -418,8 +450,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_Calculate.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_CalculateViaJsonString.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_Calculate.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_CalculateViaJsonString.cs index 9290ba63f0b7..eccaab2045bd 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_Calculate.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationQuote_CalculateViaJsonString.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Calculate price for placing a `ReservationOrder`. /// /// [OpenAPI] Calculate=>POST:"/providers/Microsoft.Capacity/calculatePrice" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationQuote_Calculate", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponseProperties))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationQuote_CalculateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Calculate price for placing a `ReservationOrder`.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/calculatePrice", ApiVersion = "2022-11-01")] - public partial class GetAzReservationQuote_Calculate : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class GetAzReservationQuote_CalculateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,24 +38,26 @@ public partial class GetAzReservationQuote_Calculate : global::System.Management /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest _body; + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// The request for reservation purchase - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request for reservation purchase", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The request for reservation purchase", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest Body { get => this._body; set => this._body = value; } + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -65,6 +71,9 @@ public partial class GetAzReservationQuote_Calculate : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -80,6 +89,19 @@ public partial class GetAzReservationQuote_Calculate : global::System.Management /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Calculate operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Calculate operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Calculate operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -91,7 +113,7 @@ public partial class GetAzReservationQuote_Calculate : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -114,24 +136,24 @@ public partial class GetAzReservationQuote_Calculate : global::System.Management /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -154,6 +176,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -175,9 +202,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public GetAzReservationQuote_Calculate() + public GetAzReservationQuote_CalculateViaJsonString() { } @@ -226,8 +253,33 @@ public GetAzReservationQuote_Calculate() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -283,7 +335,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -296,12 +348,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ReservationOrderCalculate(Body, onOk, onDefault, this, Pipeline); + await this.Client.ReservationOrderCalculateViaJsonString(_jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + 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 } }); @@ -339,12 +391,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -361,15 +413,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + 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 } }); @@ -379,12 +431,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -396,8 +448,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculatePriceResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculatePriceResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_Get.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_Get.cs index c49627b6e141..29b902eb420d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_Get.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Get specific `Reservation` details. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Get=>GET:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservation_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Get specific `Reservation` details.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", ApiVersion = "2022-11-01")] public partial class GetAzReservation_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzReservation_Get : global::System.Management.Automation /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -66,6 +84,9 @@ public partial class GetAzReservation_Get : global::System.Management.Automation [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Query)] public string Expand { get => this._expand; set => this._expand = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -122,7 +143,7 @@ public partial class GetAzReservation_Get : global::System.Management.Automation /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -145,24 +166,24 @@ public partial class GetAzReservation_Get : global::System.Management.Automation /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -185,6 +206,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -206,7 +232,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservation_Get() { @@ -257,8 +283,33 @@ public GetAzReservation_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -311,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -329,7 +380,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,Id=Id,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,Id=Id,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -367,12 +418,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -389,15 +440,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId, Id=Id, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { OrderId=OrderId, Id=Id, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -407,12 +458,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -424,8 +475,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_GetViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_GetViaIdentity.cs index e9c6d192d214..7670b6ff6bcd 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_GetViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Get specific `Reservation` details. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Get=>GET:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservation_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Get specific `Reservation` details.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", ApiVersion = "2022-11-01")] public partial class GetAzReservation_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class GetAzReservation_GetViaIdentity : global::System.Management /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -66,6 +84,9 @@ public partial class GetAzReservation_GetViaIdentity : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Query)] public string Expand { get => this._expand; set => this._expand = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class GetAzReservation_GetViaIdentity : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -123,24 +144,24 @@ public partial class GetAzReservation_GetViaIdentity : global::System.Management /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -163,6 +184,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -184,7 +210,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservation_GetViaIdentity() { @@ -235,8 +261,33 @@ public GetAzReservation_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -289,7 +340,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -323,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -361,12 +412,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -383,15 +434,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -401,12 +452,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -418,8 +469,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_GetViaIdentityReservationOrder.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_GetViaIdentityReservationOrder.cs new file mode 100644 index 000000000000..db5cbdfd1e46 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_GetViaIdentityReservationOrder.cs @@ -0,0 +1,507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; + using System; + + /// Get specific `Reservation` details. + /// + /// [OpenAPI] Get=>GET:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservation_GetViaIdentityReservationOrder")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Get specific `Reservation` details.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", ApiVersion = "2022-11-01")] + public partial class GetAzReservation_GetViaIdentityReservationOrder : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// Supported value of this query is renewProperties + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Supported value of this query is renewProperties")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Supported value of this query is renewProperties", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// Id of the reservation item + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the reservation item")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the reservation item", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ReservationId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _reservationOrderInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity ReservationOrderInputObject { get => this._reservationOrderInputObject; set => this._reservationOrderInputObject = 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.Reservations.Models.IError + /// 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.Reservations.Models.IReservationResponse + /// 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.Reservations.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzReservation_GetViaIdentityReservationOrder() + { + + } + + /// 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.Reservations.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.Reservations.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ReservationOrderInputObject?.Id != null) + { + this.ReservationOrderInputObject.Id += $"/reservations/{(global::System.Uri.EscapeDataString(this.Id.ToString()))}"; + await this.Client.ReservationGetViaIdentity(ReservationOrderInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ReservationOrderInputObject.ReservationOrderId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ReservationOrderInputObject has null value for ReservationOrderInputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ReservationOrderInputObject) ); + } + await this.Client.ReservationGet(ReservationOrderInputObject.ReservationOrderId ?? null, Id, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError + /// 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.Reservations.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.Reservations.Models.IReservationResponse + /// 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.Reservations.Models.IReservationResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_List.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_List.cs index 56bcca00f4c0..ca00d9d67ff0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_List.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// List `Reservation`s within a single `ReservationOrder`. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] List=>GET:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"List `Reservation`s within a single `ReservationOrder`.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations", ApiVersion = "2022-11-01")] public partial class GetAzReservation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,17 +37,32 @@ public partial class GetAzReservation_List : global::System.Management.Automatio /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzReservation_List : global::System.Management.Automatio [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -99,7 +120,7 @@ public partial class GetAzReservation_List : global::System.Management.Automatio /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -122,24 +143,24 @@ public partial class GetAzReservation_List : global::System.Management.Automatio /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -162,6 +183,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -183,7 +209,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservation_List() { @@ -234,8 +260,33 @@ public GetAzReservation_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -288,7 +339,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -306,7 +357,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,12 +395,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -366,15 +417,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { OrderId=OrderId }) + 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 } }); @@ -384,12 +435,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -401,15 +452,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationList + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_List1.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_List1.cs index 87618edbce5a..933566b2ae2a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_List1.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservation_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] ListAll=>GET:"/providers/Microsoft.Capacity/reservations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservation_List1", SupportsPaging = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"List the reservations and the roll up counts of reservations group by provisioning states that the user has access to in the current tenant.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservations", ApiVersion = "2022-11-01")] public partial class GetAzReservation_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,17 +40,32 @@ public partial class GetAzReservation_List1 : global::System.Management.Automati /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -61,6 +79,9 @@ public partial class GetAzReservation_List1 : global::System.Management.Automati [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -120,7 +141,7 @@ public partial class GetAzReservation_List1 : global::System.Management.Automati /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -204,24 +225,24 @@ public partial class GetAzReservation_List1 : global::System.Management.Automati /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -244,6 +265,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -265,7 +291,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservation_List1() { @@ -316,8 +342,33 @@ public GetAzReservation_List1() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -370,7 +421,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -380,6 +431,18 @@ protected override void ProcessRecord() Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("RefreshSummary")) + { + RefreshSummary = (string)this.MyInvocation.BoundParameters["RefreshSummary"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("Skiptoken")) + { + Skiptoken = (float)this.MyInvocation.BoundParameters["Skiptoken"]; + } + if (true == this.MyInvocation?.BoundParameters?.ContainsKey("Take")) + { + Take = (float)this.MyInvocation.BoundParameters["Take"]; + } try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } @@ -388,7 +451,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.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,Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null,RefreshSummary=this.InvocationInformation.BoundParameters.ContainsKey("RefreshSummary") ? RefreshSummary : null,Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : default(float?),SelectedState=this.InvocationInformation.BoundParameters.ContainsKey("SelectedState") ? SelectedState : null,Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?)}) + 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,Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null,RefreshSummary=this.InvocationInformation.BoundParameters.ContainsKey("RefreshSummary") ? RefreshSummary : null,Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : default(float?),SelectedState=this.InvocationInformation.BoundParameters.ContainsKey("SelectedState") ? SelectedState : null,Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?)}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -426,12 +489,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -448,15 +511,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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, Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null, RefreshSummary=this.InvocationInformation.BoundParameters.ContainsKey("RefreshSummary") ? RefreshSummary : null, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : default(float?), SelectedState=this.InvocationInformation.BoundParameters.ContainsKey("SelectedState") ? SelectedState : null, Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?) }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null, RefreshSummary=this.InvocationInformation.BoundParameters.ContainsKey("RefreshSummary") ? RefreshSummary : null, Skiptoken=this.InvocationInformation.BoundParameters.ContainsKey("Skiptoken") ? Skiptoken : default(float?), SelectedState=this.InvocationInformation.BoundParameters.ContainsKey("SelectedState") ? SelectedState : null, Take=this.InvocationInformation.BoundParameters.ContainsKey("Take") ? Take : default(float?) }) + 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 } }); @@ -466,12 +529,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationsListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -483,19 +546,42 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsListResult + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - if ((ulong)result.Value.Length <= this.PagingParameters.Skip) + if ((ulong)result.Value.Count <= this.PagingParameters.Skip) { - this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; + this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Count; } else { - ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); - var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Count - this.PagingParameters.Skip); + var requiredResult = result.Value.GetRange((int)this.PagingParameters.Skip, (int)toRead); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Count) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -503,7 +589,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationsOperation_List.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationsOperation_List.cs index a1061dd05398..ceff19f486ca 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationsOperation_List.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/GetAzReservationsOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// List all the operations. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservationsOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"List all the operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/operations", ApiVersion = "2022-11-01")] public partial class GetAzReservationsOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,17 +38,32 @@ public partial class GetAzReservationsOperation_List : global::System.Management /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzReservationsOperation_List : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,7 +106,7 @@ public partial class GetAzReservationsOperation_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -108,24 +129,24 @@ public partial class GetAzReservationsOperation_List : global::System.Management /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -148,6 +169,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -169,7 +195,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzReservationsOperation_List() { @@ -220,8 +246,33 @@ public GetAzReservationsOperation_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -274,7 +325,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -292,7 +343,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -330,12 +381,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -352,7 +403,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } @@ -370,12 +421,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,15 +438,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationList + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_Archive.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_Archive.cs index 97e6f85a2c71..f26dab0e2372 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_Archive.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_Archive.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Archiving a `Reservation` moves it to `Archived` state. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/archive", ApiVersion = "2022-11-01")] public partial class InvokeAzReservationArchiveReservation_Archive : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class InvokeAzReservationArchiveReservation_Archive : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class InvokeAzReservationArchiveReservation_Archive : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,7 +106,7 @@ public partial class InvokeAzReservationArchiveReservation_Archive : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -136,12 +157,12 @@ public partial class InvokeAzReservationArchiveReservation_Archive : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -174,6 +195,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -195,7 +221,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzReservationArchiveReservation_Archive() { @@ -246,8 +272,33 @@ public InvokeAzReservationArchiveReservation_Archive() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -303,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -321,7 +372,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,ReservationId=ReservationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -359,12 +410,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -381,15 +432,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, ReservationId=ReservationId }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_ArchiveViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_ArchiveViaIdentity.cs index 7c7bf996339c..6ffd63ca155f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_ArchiveViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_ArchiveViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Archiving a `Reservation` moves it to `Archived` state. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/archive", ApiVersion = "2022-11-01")] public partial class InvokeAzReservationArchiveReservation_ArchiveViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class InvokeAzReservationArchiveReservation_ArchiveViaIdentity : /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class InvokeAzReservationArchiveReservation_ArchiveViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class InvokeAzReservationArchiveReservation_ArchiveViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class InvokeAzReservationArchiveReservation_ArchiveViaIdentity : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -154,6 +175,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -175,7 +201,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzReservationArchiveReservation_ArchiveViaIdentity() { @@ -226,8 +252,33 @@ public InvokeAzReservationArchiveReservation_ArchiveViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -283,7 +334,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,7 +428,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_ArchiveViaIdentityReservationOrder.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_ArchiveViaIdentityReservationOrder.cs new file mode 100644 index 000000000000..0e5f1861f79d --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationArchiveReservation_ArchiveViaIdentityReservationOrder.cs @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; + using System; + + /// Archiving a `Reservation` moves it to `Archived` state. + /// + /// [OpenAPI] Archive=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/archive" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationArchiveReservation_ArchiveViaIdentityReservationOrder", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Archiving a `Reservation` moves it to `Archived` state.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/archive", ApiVersion = "2022-11-01")] + public partial class InvokeAzReservationArchiveReservation_ArchiveViaIdentityReservationOrder : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _reservationId; + + /// Id of the reservation item + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the reservation item")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the reservation item", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public string ReservationId { get => this._reservationId; set => this._reservationId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _reservationOrderInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity ReservationOrderInputObject { get => this._reservationOrderInputObject; set => this._reservationOrderInputObject = 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.Reservations.Models.IError + /// 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.Reservations.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public InvokeAzReservationArchiveReservation_ArchiveViaIdentityReservationOrder() + { + + } + + /// 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.Reservations.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.Reservations.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ReservationArchive' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ReservationOrderInputObject?.Id != null) + { + this.ReservationOrderInputObject.Id += $"/reservations/{(global::System.Uri.EscapeDataString(this.ReservationId.ToString()))}"; + await this.Client.ReservationArchiveViaIdentity(ReservationOrderInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ReservationOrderInputObject.ReservationOrderId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ReservationOrderInputObject has null value for ReservationOrderInputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ReservationOrderInputObject) ); + } + await this.Client.ReservationArchive(ReservationOrderInputObject.ReservationOrderId ?? null, ReservationId, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationId=ReservationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError + /// 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.Reservations.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/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_PostExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_PostExpanded.cs index dae813e8e8e2..35f9333f12a2 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_PostExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_PostExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Calculates price for exchanging `Reservations` if there are no policy errors.\n @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/calculateExchange" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationCalculateExchange_PostExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Calculates price for exchanging `Reservations` if there are no policy errors.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/calculateExchange", ApiVersion = "2022-11-01")] public partial class InvokeAzReservationCalculateExchange_PostExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +33,25 @@ public partial class InvokeAzReservationCalculateExchange_PostExpanded : global: private string __processRecordId; /// Calculate exchange request - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateExchangeRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateExchangeRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -47,6 +62,9 @@ public partial class InvokeAzReservationCalculateExchange_PostExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -60,6 +78,9 @@ public partial class InvokeAzReservationCalculateExchange_PostExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -94,7 +115,7 @@ public partial class InvokeAzReservationCalculateExchange_PostExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -121,8 +142,8 @@ public partial class InvokeAzReservationCalculateExchange_PostExpanded : global: ReadOnly = false, Description = @"List of reservations that are being returned in this exchange.", SerializedName = @"reservationsToExchange", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationToReturn[] ReservationsToExchange { get => _body.ReservationsToExchange ?? null /* arrayOf */; set => _body.ReservationsToExchange = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn) })] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationToReturn[] ReservationsToExchange { get => _body.ReservationsToExchange?.ToArray() ?? null /* fixedArrayOf */; set => _body.ReservationsToExchange = (value != null ? new System.Collections.Generic.List(value) : null); } /// List of reservations that are being purchased in this exchange. [global::System.Management.Automation.AllowEmptyCollection] @@ -133,8 +154,8 @@ public partial class InvokeAzReservationCalculateExchange_PostExpanded : global: ReadOnly = false, Description = @"List of reservations that are being purchased in this exchange.", SerializedName = @"reservationsToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest[] ReservationsToPurchase { get => _body.ReservationsToPurchase ?? null /* arrayOf */; set => _body.ReservationsToPurchase = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest[] ReservationsToPurchase { get => _body.ReservationsToPurchase?.ToArray() ?? null /* fixedArrayOf */; set => _body.ReservationsToPurchase = (value != null ? new System.Collections.Generic.List(value) : null); } /// List of savings plans that are being purchased in this exchange. [global::System.Management.Automation.AllowEmptyCollection] @@ -145,32 +166,32 @@ public partial class InvokeAzReservationCalculateExchange_PostExpanded : global: ReadOnly = false, Description = @"List of savings plans that are being purchased in this exchange.", SerializedName = @"savingsPlansToPurchase", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISavingsPlanPurchaseRequest[] SavingsPlansToPurchase { get => _body.SavingsPlansToPurchase ?? null /* arrayOf */; set => _body.SavingsPlansToPurchase = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISavingsPlanPurchaseRequest[] SavingsPlansToPurchase { get => _body.SavingsPlansToPurchase?.ToArray() ?? null /* fixedArrayOf */; set => _body.SavingsPlansToPurchase = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// 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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -214,6 +235,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservati /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -235,7 +261,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzReservationCalculateExchange_PostExpanded() { @@ -286,11 +312,36 @@ public InvokeAzReservationCalculateExchange_PostExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -302,10 +353,26 @@ public InvokeAzReservationCalculateExchange_PostExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -373,7 +440,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -391,7 +458,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + 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 } }); @@ -429,12 +496,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -451,15 +518,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + 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 } }); @@ -469,12 +536,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -486,8 +553,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_PostViaJsonFilePath.cs similarity index 77% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaIdentity.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_PostViaJsonFilePath.cs index f75a45c105ac..127d6dd7f82d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_PostViaJsonFilePath.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; - /// Purchase `ReservationOrder` and create resource under the specified URI. + /// Calculates price for exchanging `Reservations` if there are no policy errors.\n /// - /// [OpenAPI] Purchase=>PUT:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}" + /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/calculateExchange" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzReservation_PurchaseViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Purchase `ReservationOrder` and create resource under the specified URI.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationCalculateExchange_PostViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Calculates price for exchanging `Reservations` if there are no policy errors.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}", ApiVersion = "2022-11-01")] - public partial class NewAzReservation_PurchaseViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/calculateExchange", ApiVersion = "2022-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class InvokeAzReservationCalculateExchange_PostViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,33 @@ public partial class NewAzReservation_PurchaseViaIdentity : global::System.Manag /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest _body; - - /// The request for reservation purchase - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request for reservation purchase", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The request for reservation purchase", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -70,6 +78,9 @@ public partial class NewAzReservation_PurchaseViaIdentity : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -82,17 +93,22 @@ public partial class NewAzReservation_PurchaseViaIdentity : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity 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 string _jsonFilePath; + + /// Path of Json file supplied to the Post operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Post operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Post operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -112,7 +128,7 @@ public partial class NewAzReservation_PurchaseViaIdentity : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -135,24 +151,24 @@ public partial class NewAzReservation_PurchaseViaIdentity : global::System.Manag /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -173,10 +189,12 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzReservation_PurchaseViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.NewAzReservation_PurchaseViaIdentity Clone() + /// + /// a duplicate instance of InvokeAzReservationCalculateExchange_PostViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservationCalculateExchange_PostViaJsonFilePath Clone() { - var clone = new NewAzReservation_PurchaseViaIdentity(); + var clone = new InvokeAzReservationCalculateExchange_PostViaJsonFilePath(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -189,13 +207,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.NewAzReservation_ clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.Body = this.Body; + clone.JsonFilePath = this.JsonFilePath; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -216,6 +239,14 @@ protected override void EndProcessing() } } + /// + /// Initializes a new instance of the cmdlet class. + /// + public InvokeAzReservationCalculateExchange_PostViaJsonFilePath() + { + + } + /// 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 @@ -260,11 +291,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -276,10 +332,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -288,14 +360,6 @@ protected override void EndProcessing() } } - /// - /// Intializes a new instance of the cmdlet class. - /// - public NewAzReservation_PurchaseViaIdentity() - { - - } - /// Performs execution of the command. protected override void ProcessRecord() { @@ -304,7 +368,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'ReservationOrderPurchase' operation")) + if (ShouldProcess($"Call remote 'CalculateExchangePost' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -355,7 +419,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -368,24 +432,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.ReservationOrderPurchaseViaIdentity(InputObject.Id, Body, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.ReservationOrderId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.ReservationOrderPurchase(InputObject.ReservationOrderId ?? null, Body, onOk, onDefault, this, Pipeline); - } + await this.Client.CalculateExchangePostViaJsonString(_jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + 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 } }); @@ -423,12 +475,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -445,15 +497,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + 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 } }); @@ -463,12 +515,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -480,8 +532,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_Post.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_PostViaJsonString.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_Post.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_PostViaJsonString.cs index 7b44a3c5875e..511bca64ccf1 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_Post.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateExchange_PostViaJsonString.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Calculates price for exchanging `Reservations` if there are no policy errors.\n /// /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/calculateExchange" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationCalculateExchange_Post", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationCalculateExchange_PostViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Calculates price for exchanging `Reservations` if there are no policy errors.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/calculateExchange", ApiVersion = "2022-11-01")] - public partial class InvokeAzReservationCalculateExchange_Post : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class InvokeAzReservationCalculateExchange_PostViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,31 @@ public partial class InvokeAzReservationCalculateExchange_Post : global::System. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest _body; - - /// Calculate exchange request - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Calculate exchange request", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Calculate exchange request", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -70,6 +76,9 @@ public partial class InvokeAzReservationCalculateExchange_Post : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,6 +94,19 @@ public partial class InvokeAzReservationCalculateExchange_Post : global::System. /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Post operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Post operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Post operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -104,7 +126,7 @@ public partial class InvokeAzReservationCalculateExchange_Post : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -127,24 +149,24 @@ public partial class InvokeAzReservationCalculateExchange_Post : global::System. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -165,10 +187,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of InvokeAzReservationCalculateExchange_Post - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservationCalculateExchange_Post Clone() + /// a duplicate instance of InvokeAzReservationCalculateExchange_PostViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservationCalculateExchange_PostViaJsonString Clone() { - var clone = new InvokeAzReservationCalculateExchange_Post(); + var clone = new InvokeAzReservationCalculateExchange_PostViaJsonString(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -181,13 +203,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservati clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.Body = this.Body; + clone.JsonString = this.JsonString; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,9 +236,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public InvokeAzReservationCalculateExchange_Post() + public InvokeAzReservationCalculateExchange_PostViaJsonString() { } @@ -260,11 +287,36 @@ public InvokeAzReservationCalculateExchange_Post() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -276,10 +328,26 @@ public InvokeAzReservationCalculateExchange_Post() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -347,7 +415,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -360,12 +428,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CalculateExchangePost(Body, onOk, onDefault, this, Pipeline); + await this.Client.CalculateExchangePostViaJsonString(_jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + 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 } }); @@ -403,12 +471,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -425,15 +493,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + 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 } }); @@ -443,12 +511,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -460,8 +528,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateExchangeOperationResultResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateExchangeOperationResultResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostExpanded.cs index b2d0daf1de01..428cfbaaf04d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Calculate price for returning `Reservations` if there are no policy errors.\n @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationCalculateRefund_PostExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Calculate price for returning `Reservations` if there are no policy errors.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund", ApiVersion = "2022-11-01")] public partial class InvokeAzReservationCalculateRefund_PostExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,18 +33,33 @@ public partial class InvokeAzReservationCalculateRefund_PostExpanded : global::S private string __processRecordId; /// Request containing information needed for calculating refund. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateRefundRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class InvokeAzReservationCalculateRefund_PostExpanded : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class InvokeAzReservationCalculateRefund_PostExpanded : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -163,24 +184,24 @@ public partial class InvokeAzReservationCalculateRefund_PostExpanded : global::S /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -203,6 +224,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -224,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzReservationCalculateRefund_PostExpanded() { @@ -275,8 +301,33 @@ public InvokeAzReservationCalculateRefund_PostExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -332,7 +383,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -350,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,12 +439,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,15 +461,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, body=_body }) + 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 } }); @@ -428,12 +479,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -445,8 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaIdentityExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaIdentityExpanded.cs index b92636ef0e7a..afe0285f27f6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaIdentityExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Calculate price for returning `Reservations` if there are no policy errors.\n @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationCalculateRefund_PostViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Calculate price for returning `Reservations` if there are no policy errors.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund", ApiVersion = "2022-11-01")] public partial class InvokeAzReservationCalculateRefund_PostViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,18 +33,33 @@ public partial class InvokeAzReservationCalculateRefund_PostViaIdentityExpanded private string __processRecordId; /// Request containing information needed for calculating refund. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.CalculateRefundRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.CalculateRefundRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -55,6 +73,9 @@ public partial class InvokeAzReservationCalculateRefund_PostViaIdentityExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -101,7 +122,7 @@ public partial class InvokeAzReservationCalculateRefund_PostViaIdentityExpanded /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -157,24 +178,24 @@ public partial class InvokeAzReservationCalculateRefund_PostViaIdentityExpanded /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -197,6 +218,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -218,7 +244,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzReservationCalculateRefund_PostViaIdentityExpanded() { @@ -269,8 +295,33 @@ public InvokeAzReservationCalculateRefund_PostViaIdentityExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -326,7 +377,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -356,7 +407,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + 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 } }); @@ -394,12 +445,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -416,15 +467,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + 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 } }); @@ -434,12 +485,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -451,8 +502,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaJsonFilePath.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaIdentity.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaJsonFilePath.cs index f95c352f31f9..78ec5a7a6d7d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaJsonFilePath.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Calculate price for returning `Reservations` if there are no policy errors.\n /// /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationCalculateRefund_PostViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationCalculateRefund_PostViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Calculate price for returning `Reservations` if there are no policy errors.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund", ApiVersion = "2022-11-01")] - public partial class InvokeAzReservationCalculateRefund_PostViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class InvokeAzReservationCalculateRefund_PostViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,24 +38,28 @@ public partial class InvokeAzReservationCalculateRefund_PostViaIdentity : global /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest _body; + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// Request containing information needed for calculating refund. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request containing information needed for calculating refund.", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Request containing information needed for calculating refund.", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest Body { get => this._body; set => this._body = value; } + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -65,6 +73,9 @@ public partial class InvokeAzReservationCalculateRefund_PostViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -77,17 +88,22 @@ public partial class InvokeAzReservationCalculateRefund_PostViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity 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 string _jsonFilePath; + + /// Path of Json file supplied to the Post operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Post operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Post operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -99,7 +115,7 @@ public partial class InvokeAzReservationCalculateRefund_PostViaIdentity : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -117,29 +133,43 @@ public partial class InvokeAzReservationCalculateRefund_PostViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -162,6 +192,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -183,9 +218,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public InvokeAzReservationCalculateRefund_PostViaIdentity() + public InvokeAzReservationCalculateRefund_PostViaJsonFilePath() { } @@ -234,8 +269,33 @@ public InvokeAzReservationCalculateRefund_PostViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -291,7 +351,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -304,24 +364,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.CalculateRefundPostViaIdentity(InputObject.Id, Body, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.ReservationOrderId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.CalculateRefundPost(InputObject.ReservationOrderId ?? null, Body, onOk, onDefault, this, Pipeline); - } + await this.Client.CalculateRefundPostViaJsonString(ReservationOrderId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -359,12 +407,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -381,15 +429,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + 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 } }); @@ -399,12 +447,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -416,8 +464,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_Post.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaJsonString.cs similarity index 80% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_Post.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaJsonString.cs index 10b7dba1fa0c..831aa0456711 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_Post.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationCalculateRefund_PostViaJsonString.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Calculate price for returning `Reservations` if there are no policy errors.\n /// /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationCalculateRefund_Post", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationCalculateRefund_PostViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Calculate price for returning `Reservations` if there are no policy errors.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund", ApiVersion = "2022-11-01")] - public partial class InvokeAzReservationCalculateRefund_Post : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class InvokeAzReservationCalculateRefund_PostViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,24 +38,26 @@ public partial class InvokeAzReservationCalculateRefund_Post : global::System.Ma /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest _body; + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// Request containing information needed for calculating refund. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request containing information needed for calculating refund.", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Request containing information needed for calculating refund.", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundRequest Body { get => this._body; set => this._body = value; } + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -65,6 +71,9 @@ public partial class InvokeAzReservationCalculateRefund_Post : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -80,6 +89,19 @@ public partial class InvokeAzReservationCalculateRefund_Post : global::System.Ma /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Post operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Post operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Post operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -91,7 +113,7 @@ public partial class InvokeAzReservationCalculateRefund_Post : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -128,24 +150,24 @@ public partial class InvokeAzReservationCalculateRefund_Post : global::System.Ma /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -168,6 +190,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -189,9 +216,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public InvokeAzReservationCalculateRefund_Post() + public InvokeAzReservationCalculateRefund_PostViaJsonString() { } @@ -240,8 +267,33 @@ public InvokeAzReservationCalculateRefund_Post() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -297,7 +349,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -310,12 +362,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CalculateRefundPost(ReservationOrderId, Body, onOk, onDefault, this, Pipeline); + await this.Client.CalculateRefundPostViaJsonString(ReservationOrderId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,12 +405,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -375,15 +427,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, body=Body }) + 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 } }); @@ -393,12 +445,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -410,8 +462,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ICalculateRefundResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ICalculateRefundResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_PostExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_PostExpanded.cs index b0641998a453..37e0fbfe7680 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_PostExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_PostExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/exchange" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationExchange_PostExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Returns one or more `Reservations` in exchange for one or more `Reservation` purchases.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/exchange", ApiVersion = "2022-11-01")] public partial class InvokeAzReservationExchange_PostExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,13 +35,25 @@ public partial class InvokeAzReservationExchange_PostExpanded : global::System.M private string __processRecordId; /// Exchange request - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ExchangeRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ExchangeRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -49,6 +64,9 @@ public partial class InvokeAzReservationExchange_PostExpanded : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -62,6 +80,9 @@ public partial class InvokeAzReservationExchange_PostExpanded : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -96,7 +117,7 @@ public partial class InvokeAzReservationExchange_PostExpanded : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -130,24 +151,24 @@ public partial class InvokeAzReservationExchange_PostExpanded : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -191,6 +212,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservati /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -212,7 +238,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzReservationExchange_PostExpanded() { @@ -263,11 +289,36 @@ public InvokeAzReservationExchange_PostExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -279,10 +330,26 @@ public InvokeAzReservationExchange_PostExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -350,7 +417,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -368,7 +435,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + 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 } }); @@ -406,12 +473,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -428,15 +495,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + 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 } }); @@ -446,12 +513,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -463,8 +530,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_PostViaJsonFilePath.cs similarity index 77% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaIdentity.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_PostViaJsonFilePath.cs index 54779b7ca30a..4ac9b6200164 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_PostViaJsonFilePath.cs @@ -6,19 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; - /// Updates the applied scopes of the `Reservation`. + /// + /// Returns one or more `Reservations` in exchange for one or more `Reservation` purchases.\n + /// /// - /// [OpenAPI] Update=>PATCH:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}" + /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/exchange" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzReservation_UpdateViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Updates the applied scopes of the `Reservation`.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationExchange_PostViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Returns one or more `Reservations` in exchange for one or more `Reservation` purchases.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", ApiVersion = "2022-11-01")] - public partial class UpdateAzReservation_UpdateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/exchange", ApiVersion = "2022-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class InvokeAzReservationExchange_PostViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +40,20 @@ public partial class UpdateAzReservation_UpdateViaIdentity : global::System.Mana /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -44,6 +64,9 @@ public partial class UpdateAzReservation_UpdateViaIdentity : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -57,6 +80,9 @@ public partial class UpdateAzReservation_UpdateViaIdentity : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -69,17 +95,22 @@ public partial class UpdateAzReservation_UpdateViaIdentity : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity 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 string _jsonFilePath; + + /// Path of Json file supplied to the Post operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Post operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Post operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -99,7 +130,7 @@ public partial class UpdateAzReservation_UpdateViaIdentity : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -117,42 +148,29 @@ public partial class UpdateAzReservation_UpdateViaIdentity : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch _reservation; - - /// The request for reservation patch - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request for reservation patch", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The request for reservation patch", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch Reservation { get => this._reservation; set => this._reservation = 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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -173,10 +191,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzReservation_UpdateViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.UpdateAzReservation_UpdateViaIdentity Clone() + /// a duplicate instance of InvokeAzReservationExchange_PostViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservationExchange_PostViaJsonFilePath Clone() { - var clone = new UpdateAzReservation_UpdateViaIdentity(); + var clone = new InvokeAzReservationExchange_PostViaJsonFilePath(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -189,13 +207,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.UpdateAzReservati clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.Reservation = this.Reservation; + clone.JsonFilePath = this.JsonFilePath; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -216,6 +239,14 @@ protected override void EndProcessing() } } + /// + /// Initializes a new instance of the cmdlet class. + /// + public InvokeAzReservationExchange_PostViaJsonFilePath() + { + + } + /// 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 @@ -260,11 +291,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -276,10 +332,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,7 +368,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'ReservationUpdate' operation")) + if (ShouldProcess($"Call remote 'ExchangePost' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -347,7 +419,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -360,28 +432,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.ReservationUpdateViaIdentity(InputObject.Id, Reservation, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.ReservationOrderId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - if (null == InputObject.ReservationId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ReservationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.ReservationUpdate(InputObject.ReservationOrderId ?? null, InputObject.ReservationId ?? null, Reservation, onOk, onDefault, this, Pipeline); - } + await this.Client.ExchangePostViaJsonString(_jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Reservation}) + 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 } }); @@ -400,14 +456,6 @@ protected override void StopProcessing() base.StopProcessing(); } - /// - /// Intializes a new instance of the cmdlet class. - /// - public UpdateAzReservation_UpdateViaIdentity() - { - - } - /// new protected void WriteObject(object sendToPipeline) { @@ -427,12 +475,12 @@ public UpdateAzReservation_UpdateViaIdentity() /// 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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -449,15 +497,15 @@ public UpdateAzReservation_UpdateViaIdentity() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Reservation }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Reservation }) + 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 } }); @@ -467,12 +515,12 @@ public UpdateAzReservation_UpdateViaIdentity() /// 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.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -484,8 +532,26 @@ public UpdateAzReservation_UpdateViaIdentity() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_Post.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_PostViaJsonString.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_Post.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_PostViaJsonString.cs index 2840ab2afe84..bf15807d95d5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_Post.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationExchange_PostViaJsonString.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -14,13 +16,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/exchange" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationExchange_Post", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationExchange_PostViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Returns one or more `Reservations` in exchange for one or more `Reservation` purchases.\n")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/exchange", ApiVersion = "2022-11-01")] - public partial class InvokeAzReservationExchange_Post : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class InvokeAzReservationExchange_PostViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,29 +40,31 @@ public partial class InvokeAzReservationExchange_Post : global::System.Managemen /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest _body; - - /// Exchange request - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Exchange request", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Exchange request", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -72,6 +78,9 @@ public partial class InvokeAzReservationExchange_Post : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -87,6 +96,19 @@ public partial class InvokeAzReservationExchange_Post : global::System.Managemen /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Post operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Post operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Post operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -106,7 +128,7 @@ public partial class InvokeAzReservationExchange_Post : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -129,24 +151,24 @@ public partial class InvokeAzReservationExchange_Post : global::System.Managemen /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -167,10 +189,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of InvokeAzReservationExchange_Post - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservationExchange_Post Clone() + /// a duplicate instance of InvokeAzReservationExchange_PostViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservationExchange_PostViaJsonString Clone() { - var clone = new InvokeAzReservationExchange_Post(); + var clone = new InvokeAzReservationExchange_PostViaJsonString(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -183,13 +205,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservati clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.Body = this.Body; + clone.JsonString = this.JsonString; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -211,9 +238,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public InvokeAzReservationExchange_Post() + public InvokeAzReservationExchange_PostViaJsonString() { } @@ -262,11 +289,36 @@ public InvokeAzReservationExchange_Post() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -278,10 +330,26 @@ public InvokeAzReservationExchange_Post() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -349,7 +417,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -362,12 +430,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ExchangePost(Body, onOk, onDefault, this, Pipeline); + await this.Client.ExchangePostViaJsonString(_jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + 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 } }); @@ -405,12 +473,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -427,15 +495,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + 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 } }); @@ -445,12 +513,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -462,8 +530,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IExchangeOperationResultResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IExchangeOperationResultResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostExpanded.cs index 580d40c405d1..5ed785448952 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Return a reservation and get refund information. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationReturn_PostExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Return a reservation and get refund information.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return", ApiVersion = "2022-11-01")] public partial class InvokeAzReservationReturn_PostExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -31,13 +34,25 @@ public partial class InvokeAzReservationReturn_PostExpanded : global::System.Man private string __processRecordId; /// Request containing information needed for returning reservation. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -48,6 +63,9 @@ public partial class InvokeAzReservationReturn_PostExpanded : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -61,6 +79,9 @@ public partial class InvokeAzReservationReturn_PostExpanded : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -95,7 +116,7 @@ public partial class InvokeAzReservationReturn_PostExpanded : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -187,24 +208,24 @@ public partial class InvokeAzReservationReturn_PostExpanded : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -249,6 +270,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservati /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -270,7 +296,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzReservationReturn_PostExpanded() { @@ -321,11 +347,36 @@ public InvokeAzReservationReturn_PostExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -337,10 +388,26 @@ public InvokeAzReservationReturn_PostExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -408,7 +475,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -426,7 +493,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -464,12 +531,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -486,15 +553,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, body=_body }) + 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 } }); @@ -504,12 +571,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -521,8 +588,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaIdentityExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaIdentityExpanded.cs index a92766d645b0..33ec1d2db92e 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaIdentityExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Return a reservation and get refund information. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationReturn_PostViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Return a reservation and get refund information.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return", ApiVersion = "2022-11-01")] public partial class InvokeAzReservationReturn_PostViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -31,13 +34,25 @@ public partial class InvokeAzReservationReturn_PostViaIdentityExpanded : global: private string __processRecordId; /// Request containing information needed for returning reservation. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.RefundRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IRefundRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.RefundRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -48,6 +63,9 @@ public partial class InvokeAzReservationReturn_PostViaIdentityExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -61,6 +79,9 @@ public partial class InvokeAzReservationReturn_PostViaIdentityExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -103,7 +124,7 @@ public partial class InvokeAzReservationReturn_PostViaIdentityExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -181,24 +202,24 @@ public partial class InvokeAzReservationReturn_PostViaIdentityExpanded : global: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -242,6 +263,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservati /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -263,7 +289,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzReservationReturn_PostViaIdentityExpanded() { @@ -314,11 +340,36 @@ public InvokeAzReservationReturn_PostViaIdentityExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -330,10 +381,26 @@ public InvokeAzReservationReturn_PostViaIdentityExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -401,7 +468,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -431,7 +498,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + 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 } }); @@ -469,12 +536,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -491,15 +558,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + 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 } }); @@ -509,12 +576,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -526,8 +593,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaJsonFilePath.cs similarity index 77% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaIdentity.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaJsonFilePath.cs index 40471d465bbc..445b052fe988 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaJsonFilePath.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Return a reservation and get refund information. @@ -13,13 +15,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationReturn_PostViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationReturn_PostViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Return a reservation and get refund information.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return", ApiVersion = "2022-11-01")] - public partial class InvokeAzReservationReturn_PostViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class InvokeAzReservationReturn_PostViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,29 +39,33 @@ public partial class InvokeAzReservationReturn_PostViaIdentity : global::System. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest _body; - - /// Request containing information needed for returning reservation. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request containing information needed for returning reservation.", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Request containing information needed for returning reservation.", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -71,6 +79,9 @@ public partial class InvokeAzReservationReturn_PostViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -83,17 +94,22 @@ public partial class InvokeAzReservationReturn_PostViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity 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 string _jsonFilePath; + + /// Path of Json file supplied to the Post operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Post operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Post operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -113,7 +129,7 @@ public partial class InvokeAzReservationReturn_PostViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -131,29 +147,43 @@ public partial class InvokeAzReservationReturn_PostViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -174,10 +204,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of InvokeAzReservationReturn_PostViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservationReturn_PostViaIdentity Clone() + /// a duplicate instance of InvokeAzReservationReturn_PostViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservationReturn_PostViaJsonFilePath Clone() { - var clone = new InvokeAzReservationReturn_PostViaIdentity(); + var clone = new InvokeAzReservationReturn_PostViaJsonFilePath(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -190,13 +220,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservati clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.Body = this.Body; + clone.ReservationOrderId = this.ReservationOrderId; + clone.JsonFilePath = this.JsonFilePath; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -218,9 +254,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public InvokeAzReservationReturn_PostViaIdentity() + public InvokeAzReservationReturn_PostViaJsonFilePath() { } @@ -269,11 +305,36 @@ public InvokeAzReservationReturn_PostViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -285,10 +346,26 @@ public InvokeAzReservationReturn_PostViaIdentity() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -356,7 +433,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -369,24 +446,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.ReturnPostViaIdentity(InputObject.Id, Body, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.ReservationOrderId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.ReturnPost(InputObject.ReservationOrderId ?? null, Body, onOk, onDefault, this, Pipeline); - } + await this.Client.ReturnPostViaJsonString(ReservationOrderId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -424,12 +489,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -446,15 +511,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + 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 } }); @@ -464,12 +529,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -481,8 +546,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_Post.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaJsonString.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_Post.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaJsonString.cs index daa4510707f6..87f757feb9b4 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_Post.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationReturn_PostViaJsonString.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Return a reservation and get refund information. @@ -13,13 +15,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Post=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationReturn_Post", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationReturn_PostViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Return a reservation and get refund information.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/return", ApiVersion = "2022-11-01")] - public partial class InvokeAzReservationReturn_Post : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class InvokeAzReservationReturn_PostViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,29 +39,31 @@ public partial class InvokeAzReservationReturn_Post : global::System.Management. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest _body; - - /// Request containing information needed for returning reservation. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request containing information needed for returning reservation.", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Request containing information needed for returning reservation.", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -71,6 +77,9 @@ public partial class InvokeAzReservationReturn_Post : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -86,6 +95,19 @@ public partial class InvokeAzReservationReturn_Post : global::System.Management. /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Post operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Post operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Post operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -105,7 +127,7 @@ public partial class InvokeAzReservationReturn_Post : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -142,24 +164,24 @@ public partial class InvokeAzReservationReturn_Post : global::System.Management. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -180,10 +202,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of InvokeAzReservationReturn_Post - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservationReturn_Post Clone() + /// a duplicate instance of InvokeAzReservationReturn_PostViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservationReturn_PostViaJsonString Clone() { - var clone = new InvokeAzReservationReturn_Post(); + var clone = new InvokeAzReservationReturn_PostViaJsonString(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -197,13 +219,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.InvokeAzReservati clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; clone.ReservationOrderId = this.ReservationOrderId; - clone.Body = this.Body; + clone.JsonString = this.JsonString; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -225,9 +252,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public InvokeAzReservationReturn_Post() + public InvokeAzReservationReturn_PostViaJsonString() { } @@ -276,11 +303,36 @@ public InvokeAzReservationReturn_Post() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -292,10 +344,26 @@ public InvokeAzReservationReturn_Post() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -363,7 +431,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -376,12 +444,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ReturnPost(ReservationOrderId, Body, onOk, onDefault, this, Pipeline); + await this.Client.ReturnPostViaJsonString(ReservationOrderId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -419,12 +487,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -441,15 +509,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, body=Body }) + 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 } }); @@ -459,12 +527,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -476,8 +544,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_Unarchive.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_Unarchive.cs index bf2d7a2632e3..3296f5cb2ecf 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_Unarchive.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_Unarchive.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Restores a `Reservation` to the state it was before archiving.\n @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/unarchive", ApiVersion = "2022-11-01")] public partial class InvokeAzReservationUnarchiveReservation_Unarchive : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class InvokeAzReservationUnarchiveReservation_Unarchive : global: /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class InvokeAzReservationUnarchiveReservation_Unarchive : global: [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,7 +106,7 @@ public partial class InvokeAzReservationUnarchiveReservation_Unarchive : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -136,12 +157,12 @@ public partial class InvokeAzReservationUnarchiveReservation_Unarchive : global: /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -174,6 +195,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -195,7 +221,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzReservationUnarchiveReservation_Unarchive() { @@ -246,8 +272,33 @@ public InvokeAzReservationUnarchiveReservation_Unarchive() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -303,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -321,7 +372,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,ReservationId=ReservationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -359,12 +410,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -381,15 +432,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, ReservationId=ReservationId }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentity.cs index 0ae4153ade01..f32c3b554969 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// Restores a `Reservation` to the state it was before archiving.\n @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/unarchive", ApiVersion = "2022-11-01")] public partial class InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,26 @@ public partial class InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentit /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentit [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -93,7 +114,7 @@ public partial class InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentit /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -116,12 +137,12 @@ public partial class InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentit /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -154,6 +175,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -175,7 +201,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentity() { @@ -226,8 +252,33 @@ public InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -283,7 +334,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,7 +428,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentityReservationOrder.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentityReservationOrder.cs new file mode 100644 index 000000000000..590aae3a1e93 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentityReservationOrder.cs @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; + using System; + + /// Restores a `Reservation` to the state it was before archiving.\n + /// + /// [OpenAPI] Unarchive=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/unarchive" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzReservationUnarchiveReservation_UnarchiveViaIdentityReservationOrder", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Restores a `Reservation` to the state it was before archiving.\n")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}/unarchive", ApiVersion = "2022-11-01")] + public partial class InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentityReservationOrder : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _reservationId; + + /// Id of the reservation item + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the reservation item")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the reservation item", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public string ReservationId { get => this._reservationId; set => this._reservationId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _reservationOrderInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity ReservationOrderInputObject { get => this._reservationOrderInputObject; set => this._reservationOrderInputObject = 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.Reservations.Models.IError + /// 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.Reservations.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public InvokeAzReservationUnarchiveReservation_UnarchiveViaIdentityReservationOrder() + { + + } + + /// 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.Reservations.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.Reservations.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ReservationUnarchive' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ReservationOrderInputObject?.Id != null) + { + this.ReservationOrderInputObject.Id += $"/reservations/{(global::System.Uri.EscapeDataString(this.ReservationId.ToString()))}"; + await this.Client.ReservationUnarchiveViaIdentity(ReservationOrderInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ReservationOrderInputObject.ReservationOrderId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ReservationOrderInputObject has null value for ReservationOrderInputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ReservationOrderInputObject) ); + } + await this.Client.ReservationUnarchive(ReservationOrderInputObject.ReservationOrderId ?? null, ReservationId, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationId=ReservationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError + /// 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.Reservations.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/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_Merge.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_Merge.cs index bc56dcd0f240..4df5ff40f2d6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_Merge.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_Merge.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Merge, @"AzReservation_Merge", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge", ApiVersion = "2022-11-01")] public partial class MergeAzReservation_Merge : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,13 +40,25 @@ public partial class MergeAzReservation_Merge : global::System.Management.Automa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest _body; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest _body; /// The request for reservation merge [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request for reservation merge", ValueFromPipeline = true)] @@ -52,14 +67,18 @@ public partial class MergeAzReservation_Merge : global::System.Management.Automa ReadOnly = false, Description = @"The request for reservation merge", SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest Body { get => this._body; set => this._body = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -73,6 +92,9 @@ public partial class MergeAzReservation_Merge : global::System.Management.Automa [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -122,7 +144,7 @@ public partial class MergeAzReservation_Merge : global::System.Management.Automa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -145,24 +167,24 @@ public partial class MergeAzReservation_Merge : global::System.Management.Automa /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -207,6 +229,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.MergeAzReservatio /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -228,7 +255,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public MergeAzReservation_Merge() { @@ -279,11 +306,36 @@ public MergeAzReservation_Merge() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -295,10 +347,26 @@ public MergeAzReservation_Merge() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -366,7 +434,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -384,7 +452,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -422,12 +490,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -444,15 +512,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId, body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { OrderId=OrderId, body=Body }) + 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 } }); @@ -462,12 +530,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -479,9 +547,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeExpanded.cs index 3c8f21a4d34d..00f891b16317 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Merge, @"AzReservation_MergeExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge", ApiVersion = "2022-11-01")] public partial class MergeAzReservation_MergeExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,13 +36,25 @@ public partial class MergeAzReservation_MergeExpanded : global::System.Managemen private string __processRecordId; /// The request for reservation merge - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.MergeRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.MergeRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -50,6 +65,9 @@ public partial class MergeAzReservation_MergeExpanded : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -63,6 +81,9 @@ public partial class MergeAzReservation_MergeExpanded : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -112,7 +133,7 @@ public partial class MergeAzReservation_MergeExpanded : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -142,31 +163,31 @@ public partial class MergeAzReservation_MergeExpanded : global::System.Managemen Description = @"Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"sources", PossibleTypes = new [] { typeof(string) })] - public string[] ReservationId { get => _body.Source ?? null /* arrayOf */; set => _body.Source = value; } + public string[] ReservationId { get => _body.Source?.ToArray() ?? null /* fixedArrayOf */; set => _body.Source = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// 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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -211,6 +232,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.MergeAzReservatio /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -232,7 +258,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public MergeAzReservation_MergeExpanded() { @@ -283,11 +309,36 @@ public MergeAzReservation_MergeExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -299,10 +350,26 @@ public MergeAzReservation_MergeExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -370,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -388,7 +455,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -426,12 +493,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -448,15 +515,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { OrderId=OrderId, body=_body }) + 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 } }); @@ -466,12 +533,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -483,9 +550,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaIdentity.cs index 24c2341bb355..2fafd74bfe64 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Merge, @"AzReservation_MergeViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge", ApiVersion = "2022-11-01")] public partial class MergeAzReservation_MergeViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,13 +40,25 @@ public partial class MergeAzReservation_MergeViaIdentity : global::System.Manage /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest _body; + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest _body; /// The request for reservation merge [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request for reservation merge", ValueFromPipeline = true)] @@ -52,14 +67,18 @@ public partial class MergeAzReservation_MergeViaIdentity : global::System.Manage ReadOnly = false, Description = @"The request for reservation merge", SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest Body { get => this._body; set => this._body = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -73,6 +92,9 @@ public partial class MergeAzReservation_MergeViaIdentity : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -115,7 +137,7 @@ public partial class MergeAzReservation_MergeViaIdentity : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -138,24 +160,24 @@ public partial class MergeAzReservation_MergeViaIdentity : global::System.Manage /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -199,6 +221,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.MergeAzReservatio /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -220,7 +247,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public MergeAzReservation_MergeViaIdentity() { @@ -271,11 +298,36 @@ public MergeAzReservation_MergeViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -287,10 +339,26 @@ public MergeAzReservation_MergeViaIdentity() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -358,7 +426,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -388,7 +456,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + 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 } }); @@ -426,12 +494,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -448,15 +516,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + 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 } }); @@ -466,12 +534,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -483,9 +551,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaIdentityExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaIdentityExpanded.cs index 801840bd9aed..660e3f2a656c 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaIdentityExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Merge, @"AzReservation_MergeViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge", ApiVersion = "2022-11-01")] public partial class MergeAzReservation_MergeViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,13 +36,25 @@ public partial class MergeAzReservation_MergeViaIdentityExpanded : global::Syste private string __processRecordId; /// The request for reservation merge - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.MergeRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.MergeRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -50,6 +65,9 @@ public partial class MergeAzReservation_MergeViaIdentityExpanded : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -63,6 +81,9 @@ public partial class MergeAzReservation_MergeViaIdentityExpanded : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -105,7 +126,7 @@ public partial class MergeAzReservation_MergeViaIdentityExpanded : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -135,31 +156,31 @@ public partial class MergeAzReservation_MergeViaIdentityExpanded : global::Syste Description = @"Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", SerializedName = @"sources", PossibleTypes = new [] { typeof(string) })] - public string[] ReservationId { get => _body.Source ?? null /* arrayOf */; set => _body.Source = value; } + public string[] ReservationId { get => _body.Source?.ToArray() ?? null /* fixedArrayOf */; set => _body.Source = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// 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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -203,6 +224,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.MergeAzReservatio /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -224,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public MergeAzReservation_MergeViaIdentityExpanded() { @@ -275,11 +301,36 @@ public MergeAzReservation_MergeViaIdentityExpanded() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -291,10 +342,26 @@ public MergeAzReservation_MergeViaIdentityExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -362,7 +429,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -392,7 +459,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + 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 } }); @@ -430,12 +497,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -452,15 +519,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + 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 } }); @@ -470,12 +537,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -487,9 +554,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaJsonFilePath.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaJsonFilePath.cs new file mode 100644 index 000000000000..af2c3f01ffad --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaJsonFilePath.cs @@ -0,0 +1,582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; + using System; + + /// + /// Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties. + /// + /// + /// [OpenAPI] Merge=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Merge, @"AzReservation_MergeViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge", ApiVersion = "2022-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class MergeAzReservation_MergeViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Merge operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Merge operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Merge operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private string _orderId; + + /// Order Id of the reservation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Order Id of the reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ReservationOrderId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public string OrderId { get => this._orderId; set => this._orderId = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.IError + /// 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 System.Collections.Generic.List + /// 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.Reservations.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of MergeAzReservation_MergeViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.MergeAzReservation_MergeViaJsonFilePath Clone() + { + var clone = new MergeAzReservation_MergeViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.OrderId = this.OrderId; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public MergeAzReservation_MergeViaJsonFilePath() + { + + } + + /// 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.Reservations.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.Reservations.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ReservationMerge' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationMergeViaJsonString(OrderId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError + /// 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.Reservations.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 System.Collections.Generic.List + /// 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 System.Collections.Generic.List + var result = (await response); + // response should be returning an array of some kind. +Pageable + // array / / + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaJsonString.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaJsonString.cs new file mode 100644 index 000000000000..10d2ff314c00 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MergeAzReservation_MergeViaJsonString.cs @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; + using System; + + /// + /// Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties. + /// + /// + /// [OpenAPI] Merge=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Merge, @"AzReservation_MergeViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Merge the specified `Reservation`s into a new `Reservation`. The two `Reservation`s being merged must have same properties.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/merge", ApiVersion = "2022-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class MergeAzReservation_MergeViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Merge operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Merge operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Merge operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private string _orderId; + + /// Order Id of the reservation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Order Id of the reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ReservationOrderId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public string OrderId { get => this._orderId; set => this._orderId = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.IError + /// 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 System.Collections.Generic.List + /// 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.Reservations.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of MergeAzReservation_MergeViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.MergeAzReservation_MergeViaJsonString Clone() + { + var clone = new MergeAzReservation_MergeViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.OrderId = this.OrderId; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public MergeAzReservation_MergeViaJsonString() + { + + } + + /// 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.Reservations.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.Reservations.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ReservationMerge' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationMergeViaJsonString(OrderId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError + /// 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.Reservations.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 System.Collections.Generic.List + /// 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 System.Collections.Generic.List + var result = (await response); + // response should be returning an array of some kind. +Pageable + // array / / + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeExpanded.cs index 449c1ebd440e..35dd8e7565eb 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] ChangeDirectory=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Move, @"AzReservationDirectory_ChangeExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory", ApiVersion = "2022-11-01")] public partial class MoveAzReservationDirectory_ChangeExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,18 +35,33 @@ public partial class MoveAzReservationDirectory_ChangeExpanded : global::System. private string __processRecordId; /// Request body for change directory of a reservation. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -68,6 +86,9 @@ public partial class MoveAzReservationDirectory_ChangeExpanded : global::System. PossibleTypes = new [] { typeof(string) })] public string DestinationTenantId { get => _body.DestinationTenantId ?? null; set => _body.DestinationTenantId = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -94,7 +115,7 @@ public partial class MoveAzReservationDirectory_ChangeExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -131,24 +152,24 @@ public partial class MoveAzReservationDirectory_ChangeExpanded : global::System. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -171,6 +192,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -235,8 +261,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -246,7 +297,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public MoveAzReservationDirectory_ChangeExpanded() { @@ -300,7 +351,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,7 +369,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -356,12 +407,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -378,15 +429,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -396,12 +447,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -413,8 +464,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaIdentityExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaIdentityExpanded.cs index 1d02c31c4753..2799e00dc26f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaIdentityExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -15,12 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] ChangeDirectory=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Move, @"AzReservationDirectory_ChangeViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory", ApiVersion = "2022-11-01")] public partial class MoveAzReservationDirectory_ChangeViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,18 +35,33 @@ public partial class MoveAzReservationDirectory_ChangeViaIdentityExpanded : glob private string __processRecordId; /// Request body for change directory of a reservation. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ChangeDirectoryRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ChangeDirectoryRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -68,6 +86,9 @@ public partial class MoveAzReservationDirectory_ChangeViaIdentityExpanded : glob PossibleTypes = new [] { typeof(string) })] public string DestinationTenantId { get => _body.DestinationTenantId ?? null; set => _body.DestinationTenantId = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -102,7 +123,7 @@ public partial class MoveAzReservationDirectory_ChangeViaIdentityExpanded : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -125,24 +146,24 @@ public partial class MoveAzReservationDirectory_ChangeViaIdentityExpanded : glob /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -165,6 +186,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -229,8 +255,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -240,7 +291,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public MoveAzReservationDirectory_ChangeViaIdentityExpanded() { @@ -294,7 +345,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -324,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + 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 } }); @@ -362,12 +413,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -384,15 +435,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + 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 } }); @@ -402,12 +453,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -419,8 +470,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaJsonFilePath.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaJsonFilePath.cs new file mode 100644 index 000000000000..c4a0f7b3676d --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaJsonFilePath.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.Reservations.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; + using System; + + /// + /// Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id + /// + /// + /// [OpenAPI] ChangeDirectory=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Move, @"AzReservationDirectory_ChangeViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory", ApiVersion = "2022-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class MoveAzReservationDirectory_ChangeViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Change operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Change operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Change operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.IError + /// 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.Reservations.Models.IChangeDirectoryResponse + /// 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.Reservations.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public MoveAzReservationDirectory_ChangeViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ReservationOrderChangeDirectory' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationOrderChangeDirectoryViaJsonString(ReservationOrderId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError + /// 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.Reservations.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.Reservations.Models.IChangeDirectoryResponse + /// 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.Reservations.Models.IChangeDirectoryResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_Change.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaJsonString.cs similarity index 80% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_Change.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaJsonString.cs index aaee827d56ab..af174fb6bfb5 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_Change.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/MoveAzReservationDirectory_ChangeViaJsonString.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -14,13 +16,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// /// [OpenAPI] ChangeDirectory=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Move, @"AzReservationDirectory_Change", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Move, @"AzReservationDirectory_ChangeViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory", ApiVersion = "2022-11-01")] - public partial class MoveAzReservationDirectory_Change : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class MoveAzReservationDirectory_ChangeViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,24 +40,26 @@ public partial class MoveAzReservationDirectory_Change : global::System.Manageme /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest _body; + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); - /// Request body for change directory of a reservation. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Request body for change directory of a reservation.", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Request body for change directory of a reservation.", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryRequest Body { get => this._body; set => this._body = value; } + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -67,6 +73,9 @@ public partial class MoveAzReservationDirectory_Change : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -82,6 +91,19 @@ public partial class MoveAzReservationDirectory_Change : global::System.Manageme /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Change operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Change operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Change operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -93,7 +115,7 @@ public partial class MoveAzReservationDirectory_Change : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -130,24 +152,24 @@ public partial class MoveAzReservationDirectory_Change : global::System.Manageme /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -170,6 +192,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -234,8 +261,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -245,9 +297,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public MoveAzReservationDirectory_Change() + public MoveAzReservationDirectory_ChangeViaJsonString() { } @@ -299,7 +351,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,12 +364,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ReservationOrderChangeDirectory(ReservationOrderId, Body, onOk, onDefault, this, Pipeline); + await this.Client.ReservationOrderChangeDirectoryViaJsonString(ReservationOrderId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +407,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,15 +429,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, body=Body }) + 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 } }); @@ -395,12 +447,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,8 +464,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IChangeDirectoryResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IChangeDirectoryResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseExpanded.cs index 69a2348f18f0..e8b8ddf993b1 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; - /// Purchase `ReservationOrder` and create resource under the specified URI. + /// Purchase `ReservationOrder` and purchase resource under the specified URI. /// /// [OpenAPI] Purchase=>PUT:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzReservation_PurchaseExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Purchase `ReservationOrder` and create resource under the specified URI.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Purchase `ReservationOrder` and purchase resource under the specified URI.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}", ApiVersion = "2022-11-01")] public partial class NewAzReservation_PurchaseExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +33,25 @@ public partial class NewAzReservation_PurchaseExpanded : global::System.Manageme private string __processRecordId; /// The request for reservation purchase - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. @@ -50,7 +65,7 @@ public partial class NewAzReservation_PurchaseExpanded : global::System.Manageme Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - public string[] AppliedScope { get => _body.AppliedScopes ?? null /* arrayOf */; set => _body.AppliedScopes = value; } + public string[] AppliedScope { get => _body.AppliedScopes?.ToArray() ?? null /* fixedArrayOf */; set => _body.AppliedScopes = (value != null ? new System.Collections.Generic.List(value) : null); } /// Display name [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name")] @@ -117,9 +132,9 @@ public partial class NewAzReservation_PurchaseExpanded : global::System.Manageme ReadOnly = false, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType AppliedScopeType { get => _body.AppliedScopeType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); set => _body.AppliedScopeType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + public string AppliedScopeType { get => _body.AppliedScopeType ?? null; set => _body.AppliedScopeType = value; } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -134,9 +149,9 @@ public partial class NewAzReservation_PurchaseExpanded : global::System.Manageme ReadOnly = false, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan BillingPlan { get => _body.BillingPlan ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); set => _body.BillingPlan = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + public string BillingPlan { get => _body.BillingPlan ?? null; set => _body.BillingPlan = value; } /// Subscription that will be charged for purchasing reservation or savings plan [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Subscription that will be charged for purchasing reservation or savings plan")] @@ -154,6 +169,9 @@ public partial class NewAzReservation_PurchaseExpanded : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -178,6 +196,9 @@ public partial class NewAzReservation_PurchaseExpanded : global::System.Manageme PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _body.DisplayName ?? null; set => _body.DisplayName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -201,9 +222,9 @@ public partial class NewAzReservation_PurchaseExpanded : global::System.Manageme ReadOnly = false, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility InstanceFlexibility { get => _body.InstanceFlexibility ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); set => _body.InstanceFlexibility = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + public string InstanceFlexibility { get => _body.InstanceFlexibility ?? null; set => _body.InstanceFlexibility = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -238,7 +259,7 @@ public partial class NewAzReservation_PurchaseExpanded : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -302,9 +323,9 @@ public partial class NewAzReservation_PurchaseExpanded : global::System.Manageme ReadOnly = false, Description = @"The type of the resource that is being reserved.", SerializedName = @"reservedResourceType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType ReservedResourceType { get => _body.ReservedResourceType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType)""); set => _body.ReservedResourceType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + public string ReservedResourceType { get => _body.ReservedResourceType ?? null; set => _body.ReservedResourceType = value; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is the date-time when the Azure hybrid benefit needs to be reviewed.")] @@ -336,33 +357,33 @@ public partial class NewAzReservation_PurchaseExpanded : global::System.Manageme ReadOnly = false, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm Term { get => _body.Term ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm)""); set => _body.Term = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + public string Term { get => _body.Term ?? null; set => _body.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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -407,6 +428,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.NewAzReservation_ /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -471,11 +497,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -487,10 +538,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -500,7 +567,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzReservation_PurchaseExpanded() { @@ -566,7 +633,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -584,7 +651,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -622,12 +689,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -644,15 +711,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, body=_body }) + 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 } }); @@ -662,12 +729,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -679,8 +746,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaIdentityExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaIdentityExpanded.cs index a26066378c31..aeb470fada75 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaIdentityExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaIdentityExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; - /// Purchase `ReservationOrder` and create resource under the specified URI. + /// Purchase `ReservationOrder` and purchase resource under the specified URI. /// /// [OpenAPI] Purchase=>PUT:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzReservation_PurchaseViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Purchase `ReservationOrder` and create resource under the specified URI.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Purchase `ReservationOrder` and purchase resource under the specified URI.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}", ApiVersion = "2022-11-01")] public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +33,25 @@ public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::Syst private string __processRecordId; /// The request for reservation purchase - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.PurchaseRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPurchaseRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.PurchaseRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. @@ -50,7 +65,7 @@ public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::Syst Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - public string[] AppliedScope { get => _body.AppliedScopes ?? null /* arrayOf */; set => _body.AppliedScopes = value; } + public string[] AppliedScope { get => _body.AppliedScopes?.ToArray() ?? null /* fixedArrayOf */; set => _body.AppliedScopes = (value != null ? new System.Collections.Generic.List(value) : null); } /// Display name [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name")] @@ -117,9 +132,9 @@ public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType AppliedScopeType { get => _body.AppliedScopeType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); set => _body.AppliedScopeType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + public string AppliedScopeType { get => _body.AppliedScopeType ?? null; set => _body.AppliedScopeType = value; } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -134,9 +149,9 @@ public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"Represent the billing plans.", SerializedName = @"billingPlan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan BillingPlan { get => _body.BillingPlan ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationBillingPlan)""); set => _body.BillingPlan = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Upfront", "Monthly")] + public string BillingPlan { get => _body.BillingPlan ?? null; set => _body.BillingPlan = value; } /// Subscription that will be charged for purchasing reservation or savings plan [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Subscription that will be charged for purchasing reservation or savings plan")] @@ -154,6 +169,9 @@ public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -178,6 +196,9 @@ public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::Syst PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _body.DisplayName ?? null; set => _body.DisplayName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -209,9 +230,9 @@ public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility InstanceFlexibility { get => _body.InstanceFlexibility ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); set => _body.InstanceFlexibility = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + public string InstanceFlexibility { get => _body.InstanceFlexibility ?? null; set => _body.InstanceFlexibility = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -246,7 +267,7 @@ public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -296,9 +317,9 @@ public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"The type of the resource that is being reserved.", SerializedName = @"reservedResourceType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType ReservedResourceType { get => _body.ReservedResourceType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservedResourceType)""); set => _body.ReservedResourceType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("VirtualMachines", "SqlDatabases", "SuseLinux", "CosmosDb", "RedHat", "SqlDataWarehouse", "VMwareCloudSimple", "RedHatOsa", "Databricks", "AppService", "ManagedDisk", "BlockBlob", "RedisCache", "AzureDataExplorer", "MySql", "MariaDb", "PostgreSql", "DedicatedHost", "SapHana", "SqlAzureHybridBenefit", "AVS", "DataFactory", "NetAppStorage", "AzureFiles", "SqlEdge", "VirtualMachineSoftware")] + public string ReservedResourceType { get => _body.ReservedResourceType ?? null; set => _body.ReservedResourceType = value; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is the date-time when the Azure hybrid benefit needs to be reviewed.")] @@ -330,33 +351,33 @@ public partial class NewAzReservation_PurchaseViaIdentityExpanded : global::Syst ReadOnly = false, Description = @"Represent the term of reservation.", SerializedName = @"term", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm Term { get => _body.Term ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.ReservationTerm)""); set => _body.Term = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("P1Y", "P3Y", "P5Y")] + public string Term { get => _body.Term ?? null; set => _body.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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -400,6 +421,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.NewAzReservation_ /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -464,11 +490,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -480,10 +531,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -493,7 +560,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzReservation_PurchaseViaIdentityExpanded() { @@ -559,7 +626,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -589,7 +656,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + 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 } }); @@ -627,12 +694,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -649,15 +716,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -667,12 +734,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -684,8 +751,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaJsonFilePath.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaJsonFilePath.cs new file mode 100644 index 000000000000..9a305e1fc501 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaJsonFilePath.cs @@ -0,0 +1,571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; + using System; + + /// Purchase `ReservationOrder` and purchase resource under the specified URI. + /// + /// [OpenAPI] Purchase=>PUT:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzReservation_PurchaseViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Purchase `ReservationOrder` and purchase resource under the specified URI.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}", ApiVersion = "2022-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class NewAzReservation_PurchaseViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Purchase operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Purchase operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Purchase operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.IError + /// 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.Reservations.Models.IReservationOrderResponse + /// 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.Reservations.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzReservation_PurchaseViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.NewAzReservation_PurchaseViaJsonFilePath Clone() + { + var clone = new NewAzReservation_PurchaseViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ReservationOrderId = this.ReservationOrderId; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzReservation_PurchaseViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ReservationOrderPurchase' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationOrderPurchaseViaJsonString(ReservationOrderId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError + /// 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.Reservations.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.Reservations.Models.IReservationOrderResponse + /// 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.Reservations.Models.IReservationOrderResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_Purchase.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaJsonString.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_Purchase.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaJsonString.cs index a4ba72d6ac3c..892417f10157 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_Purchase.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/NewAzReservation_PurchaseViaJsonString.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; - /// Purchase `ReservationOrder` and create resource under the specified URI. + /// Purchase `ReservationOrder` and purchase resource under the specified URI. /// /// [OpenAPI] Purchase=>PUT:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzReservation_Purchase", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Purchase `ReservationOrder` and create resource under the specified URI.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzReservation_PurchaseViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Purchase `ReservationOrder` and purchase resource under the specified URI.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}", ApiVersion = "2022-11-01")] - public partial class NewAzReservation_Purchase : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class NewAzReservation_PurchaseViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,31 @@ public partial class NewAzReservation_Purchase : global::System.Management.Autom /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest _body; - - /// The request for reservation purchase - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request for reservation purchase", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The request for reservation purchase", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPurchaseRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -70,6 +76,9 @@ public partial class NewAzReservation_Purchase : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,6 +94,19 @@ public partial class NewAzReservation_Purchase : global::System.Management.Autom /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Purchase operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Purchase operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Purchase operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -104,7 +126,7 @@ public partial class NewAzReservation_Purchase : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -141,24 +163,24 @@ public partial class NewAzReservation_Purchase : global::System.Management.Autom /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -179,10 +201,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of NewAzReservation_Purchase - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.NewAzReservation_Purchase Clone() + /// a duplicate instance of NewAzReservation_PurchaseViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.NewAzReservation_PurchaseViaJsonString Clone() { - var clone = new NewAzReservation_Purchase(); + var clone = new NewAzReservation_PurchaseViaJsonString(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -196,13 +218,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.NewAzReservation_ clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; clone.ReservationOrderId = this.ReservationOrderId; - clone.Body = this.Body; + clone.JsonString = this.JsonString; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -267,11 +294,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -283,10 +335,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -296,9 +364,9 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public NewAzReservation_Purchase() + public NewAzReservation_PurchaseViaJsonString() { } @@ -362,7 +430,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -375,12 +443,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ReservationOrderPurchase(ReservationOrderId, Body, onOk, onDefault, this, Pipeline); + await this.Client.ReservationOrderPurchaseViaJsonString(ReservationOrderId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -418,12 +486,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -440,15 +508,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ReservationOrderId=ReservationOrderId, body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { ReservationOrderId=ReservationOrderId, body=Body }) + 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 } }); @@ -458,12 +526,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -475,8 +543,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitExpanded.cs index ac09b0931a6e..a1b6c0b994df 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Split, @"AzReservation_SplitExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Split a `Reservation` into two `Reservation`s with specified quantity distribution.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split", ApiVersion = "2022-11-01")] public partial class SplitAzReservation_SplitExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,13 +36,25 @@ public partial class SplitAzReservation_SplitExpanded : global::System.Managemen private string __processRecordId; /// The request for reservation split - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SplitRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SplitRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -50,6 +65,9 @@ public partial class SplitAzReservation_SplitExpanded : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -63,6 +81,9 @@ public partial class SplitAzReservation_SplitExpanded : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -112,7 +133,7 @@ public partial class SplitAzReservation_SplitExpanded : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -140,7 +161,7 @@ public partial class SplitAzReservation_SplitExpanded : global::System.Managemen Description = @"List of the quantities in the new reservations to create.", SerializedName = @"quantities", PossibleTypes = new [] { typeof(int) })] - public int[] Quantity { get => _body.Quantity ?? null /* arrayOf */; set => _body.Quantity = value; } + public int[] Quantity { get => _body.Quantity?.ToArray() ?? null /* fixedArrayOf */; set => _body.Quantity = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} @@ -160,24 +181,24 @@ public partial class SplitAzReservation_SplitExpanded : global::System.Managemen /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -222,6 +243,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.SplitAzReservatio /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -286,11 +312,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -302,10 +353,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -373,7 +440,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -391,7 +458,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -404,7 +471,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public SplitAzReservation_SplitExpanded() { @@ -437,12 +504,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -459,15 +526,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { OrderId=OrderId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -477,12 +544,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -494,9 +561,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaIdentityExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaIdentityExpanded.cs index 1b362604aec2..141e10f3b2e6 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaIdentityExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Split, @"AzReservation_SplitViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Split a `Reservation` into two `Reservation`s with specified quantity distribution.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split", ApiVersion = "2022-11-01")] public partial class SplitAzReservation_SplitViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,13 +36,25 @@ public partial class SplitAzReservation_SplitViaIdentityExpanded : global::Syste private string __processRecordId; /// The request for reservation split - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.SplitRequest(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.ISplitRequest _body = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.SplitRequest(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -50,6 +65,9 @@ public partial class SplitAzReservation_SplitViaIdentityExpanded : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -63,6 +81,9 @@ public partial class SplitAzReservation_SplitViaIdentityExpanded : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -105,7 +126,7 @@ public partial class SplitAzReservation_SplitViaIdentityExpanded : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -133,7 +154,7 @@ public partial class SplitAzReservation_SplitViaIdentityExpanded : global::Syste Description = @"List of the quantities in the new reservations to create.", SerializedName = @"quantities", PossibleTypes = new [] { typeof(int) })] - public int[] Quantity { get => _body.Quantity ?? null /* arrayOf */; set => _body.Quantity = value; } + public int[] Quantity { get => _body.Quantity?.ToArray() ?? null /* fixedArrayOf */; set => _body.Quantity = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} @@ -153,24 +174,24 @@ public partial class SplitAzReservation_SplitViaIdentityExpanded : global::Syste /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -214,6 +235,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.SplitAzReservatio /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -278,11 +304,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -294,10 +345,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -365,7 +432,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -395,7 +462,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body}) + 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 } }); @@ -408,7 +475,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public SplitAzReservation_SplitViaIdentityExpanded() { @@ -441,12 +508,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -463,15 +530,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + 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 } }); @@ -481,12 +548,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -498,9 +565,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaIdentity.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaJsonFilePath.cs similarity index 76% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaIdentity.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaJsonFilePath.cs index 38946e76fbc2..64090cf5fc0d 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaIdentity.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaJsonFilePath.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -15,13 +17,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Split=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Split, @"AzReservation_SplitViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Split, @"AzReservation_SplitViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Split a `Reservation` into two `Reservation`s with specified quantity distribution.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split", ApiVersion = "2022-11-01")] - public partial class SplitAzReservation_SplitViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class SplitAzReservation_SplitViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,29 +41,33 @@ public partial class SplitAzReservation_SplitViaIdentity : global::System.Manage /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest _body; - - /// The request for reservation split - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request for reservation split", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The request for reservation split", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -73,6 +81,9 @@ public partial class SplitAzReservation_SplitViaIdentity : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -85,17 +96,22 @@ public partial class SplitAzReservation_SplitViaIdentity : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _inputObject; - - /// Identity Parameter - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity 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 string _jsonFilePath; + + /// Path of Json file supplied to the Split operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Split operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Split operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -112,10 +128,25 @@ public partial class SplitAzReservation_SplitViaIdentity : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + /// Backing field for property. + private string _orderId; + + /// Order Id of the reservation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Order Id of the reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ReservationOrderId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public string OrderId { get => this._orderId; set => this._orderId = value; } + /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -138,24 +169,24 @@ public partial class SplitAzReservation_SplitViaIdentity : global::System.Manage /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -176,10 +207,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of SplitAzReservation_SplitViaIdentity - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.SplitAzReservation_SplitViaIdentity Clone() + /// a duplicate instance of SplitAzReservation_SplitViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.SplitAzReservation_SplitViaJsonFilePath Clone() { - var clone = new SplitAzReservation_SplitViaIdentity(); + var clone = new SplitAzReservation_SplitViaJsonFilePath(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -192,13 +223,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.SplitAzReservatio clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone.Body = this.Body; + clone.OrderId = this.OrderId; + clone.JsonFilePath = this.JsonFilePath; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -263,11 +300,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -279,10 +341,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -350,7 +428,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -363,24 +441,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - if (InputObject?.Id != null) - { - await this.Client.ReservationSplitViaIdentity(InputObject.Id, Body, onOk, onDefault, this, Pipeline); - } - else - { - // try to call with PATH parameters from Input Object - if (null == InputObject.ReservationOrderId) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } - await this.Client.ReservationSplit(InputObject.ReservationOrderId ?? null, Body, onOk, onDefault, this, Pipeline); - } + await this.Client.ReservationSplitViaJsonString(OrderId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -393,9 +459,9 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public SplitAzReservation_SplitViaIdentity() + public SplitAzReservation_SplitViaJsonFilePath() { } @@ -426,12 +492,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -448,15 +514,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + 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 } }); @@ -466,12 +532,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -483,9 +549,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_Split.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaJsonString.cs similarity index 78% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_Split.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaJsonString.cs index dc3f7f85dde2..0b7ee8f41a95 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_Split.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/SplitAzReservation_SplitViaJsonString.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; /// @@ -15,13 +17,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// [OpenAPI] Split=>POST:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.InternalExport] - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Split, @"AzReservation_Split", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Split, @"AzReservation_SplitViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Split a `Reservation` into two `Reservation`s with specified quantity distribution.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/split", ApiVersion = "2022-11-01")] - public partial class SplitAzReservation_Split : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class SplitAzReservation_SplitViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,29 +41,31 @@ public partial class SplitAzReservation_Split : global::System.Management.Automa /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest _body; - - /// The request for reservation split - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request for reservation split", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The request for reservation split", - SerializedName = @"body", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest Body { get => this._body; set => this._body = 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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -73,6 +79,9 @@ public partial class SplitAzReservation_Split : global::System.Management.Automa [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -88,6 +97,19 @@ public partial class SplitAzReservation_Split : global::System.Management.Automa /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Split operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Split operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Split operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -122,7 +144,7 @@ public partial class SplitAzReservation_Split : global::System.Management.Automa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -145,24 +167,24 @@ public partial class SplitAzReservation_Split : global::System.Management.Automa /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -183,10 +205,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of SplitAzReservation_Split - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.SplitAzReservation_Split Clone() + /// a duplicate instance of SplitAzReservation_SplitViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.SplitAzReservation_SplitViaJsonString Clone() { - var clone = new SplitAzReservation_Split(); + var clone = new SplitAzReservation_SplitViaJsonString(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -200,13 +222,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.SplitAzReservatio clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; clone.OrderId = this.OrderId; - clone.Body = this.Body; + clone.JsonString = this.JsonString; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -271,11 +298,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -287,10 +339,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -358,7 +426,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -371,12 +439,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ReservationSplit(OrderId, Body, onOk, onDefault, this, Pipeline); + await this.Client.ReservationSplitViaJsonString(OrderId, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -389,9 +457,9 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public SplitAzReservation_Split() + public SplitAzReservation_SplitViaJsonString() { } @@ -422,12 +490,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -444,15 +512,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId, body=Body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { OrderId=OrderId, body=Body }) + 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 } }); @@ -462,12 +530,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse[] + /// the body result as a System.Collections.Generic.List /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task> response) { using( NoSynchronizationContext ) { @@ -479,9 +547,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be System.Collections.Generic.List + var result = (await response); // response should be returning an array of some kind. +Pageable // array / / - WriteObject(await response, true); + if (null != result) + { + if (0 == _responseSize && 1 == result.Count) + { + _firstResponse = result[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateExpanded.cs index c4ead3bbb3db..0664455bf632 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; - /// Updates the applied scopes of the `Reservation`. + /// update the applied scopes of the `Reservation`. /// /// [OpenAPI] Update=>PATCH:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzReservation_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Updates the applied scopes of the `Reservation`.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"update the applied scopes of the `Reservation`.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", ApiVersion = "2022-11-01")] public partial class UpdateAzReservation_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +37,20 @@ public partial class UpdateAzReservation_UpdateExpanded : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// The request for reservation patch - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Patch(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Patch(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property @@ -50,7 +65,7 @@ public partial class UpdateAzReservation_UpdateExpanded : global::System.Managem Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - public string[] AppliedScope { get => _parametersBody.AppliedScope ?? null /* arrayOf */; set => _parametersBody.AppliedScope = value; } + public string[] AppliedScope { get => _parametersBody.AppliedScope?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.AppliedScope = (value != null ? new System.Collections.Generic.List(value) : null); } /// Display name [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name")] @@ -117,9 +132,9 @@ public partial class UpdateAzReservation_UpdateExpanded : global::System.Managem ReadOnly = false, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType AppliedScopeType { get => _parametersBody.AppliedScopeType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); set => _parametersBody.AppliedScopeType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + public string AppliedScopeType { get => _parametersBody.AppliedScopeType ?? null; set => _parametersBody.AppliedScopeType = value; } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -131,6 +146,9 @@ public partial class UpdateAzReservation_UpdateExpanded : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -144,6 +162,9 @@ public partial class UpdateAzReservation_UpdateExpanded : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -182,9 +203,9 @@ public partial class UpdateAzReservation_UpdateExpanded : global::System.Managem ReadOnly = false, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility InstanceFlexibility { get => _parametersBody.InstanceFlexibility ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); set => _parametersBody.InstanceFlexibility = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + public string InstanceFlexibility { get => _parametersBody.InstanceFlexibility ?? null; set => _parametersBody.InstanceFlexibility = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -234,7 +255,7 @@ public partial class UpdateAzReservation_UpdateExpanded : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -273,8 +294,8 @@ public partial class UpdateAzReservation_UpdateExpanded : global::System.Managem ReadOnly = false, Description = @".", SerializedName = @"renewProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties RenewProperty { get => _parametersBody.RenewProperty ?? null /* object */; set => _parametersBody.RenewProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties RenewProperty { get => _parametersBody.RenewProperty ?? null /* object */; set => _parametersBody.RenewProperty = value; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is the date-time when the Azure hybrid benefit needs to be reviewed.")] @@ -292,24 +313,24 @@ public partial class UpdateAzReservation_UpdateExpanded : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -355,6 +376,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.UpdateAzReservati /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -419,11 +445,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -435,10 +486,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -506,7 +573,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -519,12 +586,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ReservationUpdate(OrderId, Id, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.ReservationUpdate(OrderId, Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,Id=Id,body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,Id=Id}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -544,7 +611,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzReservation_UpdateExpanded() { @@ -570,12 +637,12 @@ public UpdateAzReservation_UpdateExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -592,15 +659,15 @@ public UpdateAzReservation_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId, Id=Id, body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { OrderId=OrderId, Id=Id, body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -610,12 +677,12 @@ public UpdateAzReservation_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -627,8 +694,26 @@ public UpdateAzReservation_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaIdentityExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaIdentityExpanded.cs index 69a7b5c6f643..a011dc25b647 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaIdentityExpanded.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaIdentityExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; - /// Updates the applied scopes of the `Reservation`. + /// update the applied scopes of the `Reservation`. /// /// [OpenAPI] Update=>PATCH:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzReservation_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Updates the applied scopes of the `Reservation`.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"update the applied scopes of the `Reservation`.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", ApiVersion = "2022-11-01")] public partial class UpdateAzReservation_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +37,20 @@ public partial class UpdateAzReservation_UpdateViaIdentityExpanded : global::Sys /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// The request for reservation patch - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.Patch(); + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Patch(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; /// /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property @@ -50,7 +65,7 @@ public partial class UpdateAzReservation_UpdateViaIdentityExpanded : global::Sys Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", SerializedName = @"appliedScopes", PossibleTypes = new [] { typeof(string) })] - public string[] AppliedScope { get => _parametersBody.AppliedScope ?? null /* arrayOf */; set => _parametersBody.AppliedScope = value; } + public string[] AppliedScope { get => _parametersBody.AppliedScope?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.AppliedScope = (value != null ? new System.Collections.Generic.List(value) : null); } /// Display name [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name")] @@ -117,9 +132,9 @@ public partial class UpdateAzReservation_UpdateViaIdentityExpanded : global::Sys ReadOnly = false, Description = @"Type of the Applied Scope.", SerializedName = @"appliedScopeType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType AppliedScopeType { get => _parametersBody.AppliedScopeType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.AppliedScopeType)""); set => _parametersBody.AppliedScopeType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + public string AppliedScopeType { get => _parametersBody.AppliedScopeType ?? null; set => _parametersBody.AppliedScopeType = value; } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -131,6 +146,9 @@ public partial class UpdateAzReservation_UpdateViaIdentityExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -144,6 +162,9 @@ public partial class UpdateAzReservation_UpdateViaIdentityExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -175,9 +196,9 @@ public partial class UpdateAzReservation_UpdateViaIdentityExpanded : global::Sys ReadOnly = false, Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", SerializedName = @"instanceFlexibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility))] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility InstanceFlexibility { get => _parametersBody.InstanceFlexibility ?? ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support.InstanceFlexibility)""); set => _parametersBody.InstanceFlexibility = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + public string InstanceFlexibility { get => _parametersBody.InstanceFlexibility ?? null; set => _parametersBody.InstanceFlexibility = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -212,7 +233,7 @@ public partial class UpdateAzReservation_UpdateViaIdentityExpanded : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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")] @@ -251,8 +272,8 @@ public partial class UpdateAzReservation_UpdateViaIdentityExpanded : global::Sys ReadOnly = false, Description = @".", SerializedName = @"renewProperties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatchPropertiesRenewProperties RenewProperty { get => _parametersBody.RenewProperty ?? null /* object */; set => _parametersBody.RenewProperty = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties RenewProperty { get => _parametersBody.RenewProperty ?? null /* object */; set => _parametersBody.RenewProperty = value; } /// This is the date-time when the Azure hybrid benefit needs to be reviewed. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is the date-time when the Azure hybrid benefit needs to be reviewed.")] @@ -270,24 +291,24 @@ public partial class UpdateAzReservation_UpdateViaIdentityExpanded : global::Sys /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -331,6 +352,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.UpdateAzReservati /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -395,11 +421,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -411,10 +462,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -482,7 +549,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -497,7 +564,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.ReservationUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.ReservationUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate); } else { @@ -510,13 +577,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ReservationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.ReservationUpdate(InputObject.ReservationOrderId ?? null, InputObject.ReservationId ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + await this.Client.ReservationUpdate(InputObject.ReservationOrderId ?? null, InputObject.ReservationId ?? null, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -536,7 +603,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzReservation_UpdateViaIdentityExpanded() { @@ -562,12 +629,12 @@ public UpdateAzReservation_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -584,15 +651,15 @@ public UpdateAzReservation_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -602,12 +669,12 @@ public UpdateAzReservation_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -619,8 +686,26 @@ public UpdateAzReservation_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaIdentityReservationOrderExpanded.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaIdentityReservationOrderExpanded.cs new file mode 100644 index 000000000000..13d36c266f11 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaIdentityReservationOrderExpanded.cs @@ -0,0 +1,728 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; + using System; + + /// update the applied scopes of the `Reservation`. + /// + /// [OpenAPI] Update=>PATCH:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzReservation_UpdateViaIdentityReservationOrderExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"update the applied scopes of the `Reservation`.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", ApiVersion = "2022-11-01")] + public partial class UpdateAzReservation_UpdateViaIdentityReservationOrderExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// The request for reservation patch + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatch _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Patch(); + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// + /// List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property + /// will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.", + SerializedName = @"appliedScopes", + PossibleTypes = new [] { typeof(string) })] + public string[] AppliedScope { get => _parametersBody.AppliedScope?.ToArray() ?? null /* fixedArrayOf */; set => _parametersBody.AppliedScope = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Display name + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string AppliedScopePropertyDisplayName { get => _parametersBody.AppliedScopePropertyDisplayName ?? null; set => _parametersBody.AppliedScopePropertyDisplayName = value; } + + /// + /// Fully-qualified identifier of the management group where the benefit must be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully-qualified identifier of the management group where the benefit must be applied.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully-qualified identifier of the management group where the benefit must be applied.", + SerializedName = @"managementGroupId", + PossibleTypes = new [] { typeof(string) })] + public string AppliedScopePropertyManagementGroupId { get => _parametersBody.AppliedScopePropertyManagementGroupId ?? null; set => _parametersBody.AppliedScopePropertyManagementGroupId = value; } + + /// Fully-qualified identifier of the resource group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully-qualified identifier of the resource group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully-qualified identifier of the resource group.", + SerializedName = @"resourceGroupId", + PossibleTypes = new [] { typeof(string) })] + public string AppliedScopePropertyResourceGroupId { get => _parametersBody.AppliedScopePropertyResourceGroupId ?? null; set => _parametersBody.AppliedScopePropertyResourceGroupId = value; } + + /// Fully-qualified identifier of the subscription. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Fully-qualified identifier of the subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Fully-qualified identifier of the subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + public string AppliedScopePropertySubscriptionId { get => _parametersBody.AppliedScopePropertySubscriptionId ?? null; set => _parametersBody.AppliedScopePropertySubscriptionId = value; } + + /// Tenant ID where the savings plan should apply benefit. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tenant ID where the savings plan should apply benefit.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant ID where the savings plan should apply benefit.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + public string AppliedScopePropertyTenantId { get => _parametersBody.AppliedScopePropertyTenantId ?? null; set => _parametersBody.AppliedScopePropertyTenantId = value; } + + /// Type of the Applied Scope. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of the Applied Scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of the Applied Scope.", + SerializedName = @"appliedScopeType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("Single", "Shared", "ManagementGroup")] + public string AppliedScopeType { get => _parametersBody.AppliedScopeType ?? null; set => _parametersBody.AppliedScopeType = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// Id of the reservation item + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the reservation item")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the reservation item", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ReservationId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = value; } + + /// + /// Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines + /// reserved resource type. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.", + SerializedName = @"instanceFlexibility", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.PSArgumentCompleterAttribute("On", "Off")] + public string InstanceFlexibility { get => _parametersBody.InstanceFlexibility ?? null; set => _parametersBody.InstanceFlexibility = 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.Reservations.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Display name of the reservation + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the reservation")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the reservation", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => _parametersBody.Name ?? null; set => _parametersBody.Name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Setting this to true will automatically purchase a new reservation on the expiration date time. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Setting this to true will automatically purchase a new reservation on the expiration date time.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Setting this to true will automatically purchase a new reservation on the expiration date time.", + SerializedName = @"renew", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter Renew { get => _parametersBody.Renew ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.Renew = value; } + + /// . + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @".", + SerializedName = @"renewProperties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IPatchPropertiesRenewProperties RenewProperty { get => _parametersBody.RenewProperty ?? null /* object */; set => _parametersBody.RenewProperty = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity _reservationOrderInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity ReservationOrderInputObject { get => this._reservationOrderInputObject; set => this._reservationOrderInputObject = value; } + + /// This is the date-time when the Azure hybrid benefit needs to be reviewed. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This is the date-time when the Azure hybrid benefit needs to be reviewed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is the date-time when the Azure hybrid benefit needs to be reviewed.", + SerializedName = @"reviewDateTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime ReviewDateTime { get => _parametersBody.ReviewDateTime ?? default(global::System.DateTime); set => _parametersBody.ReviewDateTime = 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.Reservations.Models.IError + /// 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.Reservations.Models.IReservationResponse + /// 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.Reservations.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzReservation_UpdateViaIdentityReservationOrderExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.UpdateAzReservation_UpdateViaIdentityReservationOrderExpanded Clone() + { + var clone = new UpdateAzReservation_UpdateViaIdentityReservationOrderExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + clone.Id = this.Id; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ReservationUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ReservationOrderInputObject?.Id != null) + { + this.ReservationOrderInputObject.Id += $"/reservations/{(global::System.Uri.EscapeDataString(this.Id.ToString()))}"; + await this.Client.ReservationUpdateViaIdentity(ReservationOrderInputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ReservationOrderInputObject.ReservationOrderId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ReservationOrderInputObject has null value for ReservationOrderInputObject.ReservationOrderId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ReservationOrderInputObject) ); + } + await this.Client.ReservationUpdate(ReservationOrderInputObject.ReservationOrderId ?? null, Id, _parametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzReservation_UpdateViaIdentityReservationOrderExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError + /// 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.Reservations.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.Reservations.Models.IReservationResponse + /// 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.Reservations.Models.IReservationResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaJsonFilePath.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..68324d6a8dfd --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaJsonFilePath.cs @@ -0,0 +1,588 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; + using System; + + /// update the applied scopes of the `Reservation`. + /// + /// [OpenAPI] Update=>PATCH:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzReservation_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"update the applied scopes of the `Reservation`.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", ApiVersion = "2022-11-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class UpdateAzReservation_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// Id of the reservation item + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the reservation item")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Id of the reservation item", + SerializedName = @"reservationId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ReservationId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private string _orderId; + + /// Order Id of the reservation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Order Id of the reservation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Order Id of the reservation", + SerializedName = @"reservationOrderId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ReservationOrderId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Path)] + public string OrderId { get => this._orderId; set => this._orderId = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Models.IError + /// 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.Reservations.Models.IReservationResponse + /// 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.Reservations.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzReservation_UpdateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.UpdateAzReservation_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzReservation_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.OrderId = this.OrderId; + clone.Id = this.Id; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ReservationUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ReservationUpdateViaJsonString(OrderId, Id, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,Id=Id}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzReservation_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError + /// 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.Reservations.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.Reservations.Models.IReservationResponse + /// 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.Reservations.Models.IReservationResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_Update.cs b/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaJsonString.cs similarity index 79% rename from generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_Update.cs rename to generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaJsonString.cs index d58d24869bb6..24b909590039 100644 --- a/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_Update.cs +++ b/generated/Reservations/Reservations.Autorest/generated/cmdlets/UpdateAzReservation_UpdateViaJsonString.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets; using System; - /// Updates the applied scopes of the `Reservation`. + /// update the applied scopes of the `Reservation`. /// /// [OpenAPI] Update=>PATCH:"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzReservation_Update", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"Updates the applied scopes of the `Reservation`.")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzReservation_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"update the applied scopes of the `Reservation`.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.HttpPath(Path = "/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}", ApiVersion = "2022-11-01")] - public partial class UpdateAzReservation_Update : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.NotSuggestDefaultParameterSet] + public partial class UpdateAzReservation_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class UpdateAzReservation_Update : global::System.Management.Auto /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] @@ -44,6 +60,9 @@ public partial class UpdateAzReservation_Update : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.ClientAPI; @@ -57,6 +76,9 @@ public partial class UpdateAzReservation_Update : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -87,6 +109,19 @@ public partial class UpdateAzReservation_Update : global::System.Management.Auto /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + /// /// cancellation delegate. Stops the cmdlet when called. /// @@ -121,7 +156,7 @@ public partial class UpdateAzReservation_Update : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -139,42 +174,29 @@ public partial class UpdateAzReservation_Update : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch _reservation; - - /// The request for reservation patch - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The request for reservation patch", ValueFromPipeline = true)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The request for reservation patch", - SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch) })] - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IPatch Reservation { get => this._reservation; set => this._reservation = 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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -195,10 +217,10 @@ protected override void BeginProcessing() } /// Creates a duplicate instance of this cmdlet (via JSON serialization). - /// a duplicate instance of UpdateAzReservation_Update - public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.UpdateAzReservation_Update Clone() + /// a duplicate instance of UpdateAzReservation_UpdateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.UpdateAzReservation_UpdateViaJsonString Clone() { - var clone = new UpdateAzReservation_Update(); + var clone = new UpdateAzReservation_UpdateViaJsonString(); clone.__correlationId = this.__correlationId; clone.__processRecordId = this.__processRecordId; clone.DefaultProfile = this.DefaultProfile; @@ -213,13 +235,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets.UpdateAzReservati clone.HttpPipelineAppend = this.HttpPipelineAppend; clone.OrderId = this.OrderId; clone.Id = this.Id; - clone.Reservation = this.Reservation; + clone.JsonString = this.JsonString; return clone; } /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -284,11 +311,36 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } case Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -300,10 +352,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -371,7 +439,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Reservations.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -384,12 +452,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ReservationUpdate(OrderId, Id, Reservation, onOk, onDefault, this, Pipeline); + await this.Client.ReservationUpdateViaJsonString(OrderId, Id, _jsonString, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,Id=Id,body=Reservation}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId,Id=Id}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -409,9 +477,9 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public UpdateAzReservation_Update() + public UpdateAzReservation_UpdateViaJsonString() { } @@ -435,12 +503,12 @@ public UpdateAzReservation_Update() /// 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.Reservations.Models.Api20221101.IError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IError /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -457,15 +525,15 @@ public UpdateAzReservation_Update() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { OrderId=OrderId, Id=Id, body=Reservation }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Reservations.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 { OrderId=OrderId, Id=Id, body=Reservation }) + 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 } }); @@ -475,12 +543,12 @@ public UpdateAzReservation_Update() /// 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.Reservations.Models.Api20221101.IReservationResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -492,8 +560,26 @@ public UpdateAzReservation_Update() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..f271ff38e492 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations +{ + using System; + using System.Collections.Generic; + using System.Text; + + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] + public class ExternalDocsAttribute : Attribute + { + + public string Description { get; } + + public string Url { get; } + + public ExternalDocsAttribute(string url) + { + Url = url; + } + + public ExternalDocsAttribute(string url, string description) + { + Url = url; + Description = description; + } + } +} diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..e7dc7cca9e15 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations +{ + public class PSArgumentCompleterAttribute : ArgumentCompleterAttribute + { + internal string[] ResourceTypes; + + public PSArgumentCompleterAttribute(params string[] argumentList) : base(CreateScriptBlock(argumentList)) + { + ResourceTypes = argumentList; + } + + public static ScriptBlock CreateScriptBlock(string[] resourceTypes) + { + List outputResourceTypes = new List(); + foreach (string resourceType in resourceTypes) + { + if (resourceType.Contains(" ")) + { + outputResourceTypes.Add("\'\'" + resourceType + "\'\'"); + } + else + { + outputResourceTypes.Add(resourceType); + } + } + string scriptResourceTypeList = "'" + String.Join("' , '", outputResourceTypes) + "'"; + string script = "param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n" + + String.Format("$values = {0}\n", scriptResourceTypeList) + + "$values | Where-Object { $_ -Like \"$wordToComplete*\" -or $_ -Like \"'$wordToComplete*\" } | Sort-Object | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }"; + ScriptBlock scriptBlock = ScriptBlock.Create(script); + return scriptBlock; + } + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index f55a6eee60a8..1971a50d355a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -20,11 +20,13 @@ public class ExportFormatPs1xml : PSCmdlet public string FilePath { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @"Id,Type"; private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private static string SelectedBySuffix = @"#Multiple"; + protected override void ProcessRecord() { try @@ -76,7 +78,7 @@ private static View CreateViewModel(ViewParameters viewParameters) Name = viewParameters.Type.FullName, ViewSelectedBy = new ViewSelectedBy { - TypeName = viewParameters.Type.FullName + TypeName = string.Concat(viewParameters.Type.FullName, SelectedBySuffix) }, TableControl = new TableControl { diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 2d914216755d..4026fe36a778 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -24,7 +24,7 @@ public class ExportModelSurface : PSCmdlet public bool UseExpandedFormat { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Reservations.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index cdf930302fef..872ccd3d5e64 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -70,9 +70,8 @@ protected override void ProcessRecord() var variantGroups = profileGroups.SelectMany(pg => pg.Variants .GroupBy(v => new { v.CmdletName, v.IsInternal }) .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), - Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) .ToArray(); - var license = new StringBuilder(); license.Append(@" # ---------------------------------------------------------------------------------- @@ -114,6 +113,7 @@ protected override void ProcessRecord() sb.Append("param("); sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) { var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index b7529ba70949..23766ae984b0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -137,7 +137,7 @@ protected override void ProcessRecord() } else { - var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().ToPsList(); sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); } @@ -148,8 +148,10 @@ protected override void ProcessRecord() } else { - var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); - sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList(); + if (!String.IsNullOrEmpty(aliasesList)) { + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } } // CmdletsToExport diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index daa530cc4cc1..52992b2aa78a 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) } } +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + $env = @{} if ($UsePreviousConfigForRecord) { $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json @@ -80,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -120,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); - foreach (var variant in variants) + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index d1ed95cc8d6f..9f3f467ac1dd 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -94,7 +94,7 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); foreach (var relatedLink in markdownInfo.RelatedLinks) { - sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"[{relatedLink}]({relatedLink}){Environment.NewLine}{Environment.NewLine}"); } File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 3076e31c72cf..84cff3f424b0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -31,7 +31,7 @@ internal class MarkdownHelpInfo public string[] Inputs { get; } public string[] Outputs { get; } public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } - public string[] RelatedLinks { get; } + public MarkdownRelatedLinkInfo[] RelatedLinks { get; } public bool SupportsShouldProcess { get; } public bool SupportsPaging { get; } @@ -67,7 +67,11 @@ public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; OnlineVersion = commentInfo.OnlineVersion; - RelatedLinks = commentInfo.RelatedLinks; + + var relatedLinkLists = new List(); + relatedLinkLists.AddRange(commentInfo.RelatedLinks?.Select(link => new MarkdownRelatedLinkInfo(link))); + relatedLinkLists.AddRange(variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Distinct()?.Select(link => new MarkdownRelatedLinkInfo(link.Url, link.Description))); + RelatedLinks = relatedLinkLists?.ToArray(); SupportsShouldProcess = variantGroup.SupportsShouldProcess; SupportsPaging = variantGroup.SupportsPaging; @@ -218,14 +222,45 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param } } + internal class MarkdownRelatedLinkInfo + { + public string Url { get; } + public string Description { get; } + + public MarkdownRelatedLinkInfo(string url) + { + Url = url; + } + + public MarkdownRelatedLinkInfo(string url, string description) + { + Url = url; + Description = description; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(Description)) + { + return Url; + } + else + { + return $@"[{Description}]({Url})"; + + } + + } + } + internal static class MarkdownTypesExtensions { public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = { - new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), - new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 39c5ff588987..b815195db219 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index b597ac75ed34..9e2afc0aed56 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -391,6 +409,9 @@ public CommentInfo(VariantGroup variantGroup) var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +441,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +464,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +512,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +541,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 18cdd5139f3e..954ff8682260 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -22,6 +22,11 @@ public class DoNotExportAttribute : Attribute { } + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class ModelCmdletAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Class)] public class InternalExportAttribute : Attribute { @@ -55,6 +60,11 @@ public class HttpPathAttribute : Attribute public string ApiVersion { get; set; } } + [AttributeUsage(AttributeTargets.Class)] + public class NotSuggestDefaultParameterSetAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { @@ -109,6 +119,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 2374e1815ffa..3cbc11bfce6b 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PowerShell { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 40645d4e8cfe..6e6b5edf8207 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/BuildTime/PsHelpers.cs @@ -67,7 +67,7 @@ public static IEnumerable GetScriptHelpInfo(params string[] modulePath public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) { - var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" )); return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) @@ -88,7 +88,7 @@ public static Guid ReadGuidFromPsd1(string psd1Path) if (File.Exists(psd1Path)) { var currentGuid = File.ReadAllLines(psd1Path) - .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault()?.Replace("'", String.Empty); guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; } diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/Context.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..12d5bb5643bc --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/Context.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.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.Reservations.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.Reservations.Reservations Client { get; } + } +} diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/Events.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/Events.cs index be381f546d43..2b491e3f80f7 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/Events.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/Events.cs @@ -22,6 +22,6 @@ public static partial class Events public const string FollowingNextLink = nameof(FollowingNextLink); public const string DelayBeforePolling = nameof(DelayBeforePolling); public const string Polling = nameof(Polling); - + public const string Progress = nameof(Progress); } -} \ No newline at end of file +} diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/ISendAsync.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/ISendAsync.cs index 985760d8ebc7..be79da4f4451 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime using System.Threading.Tasks; using System.Collections; using System.Linq; + using System; + /// /// The interface for sending an HTTP request across the wire. @@ -70,6 +72,7 @@ public interface ISendAsyncTerminalFactory public partial class HttpPipeline : ISendAsync { + private const int DefaultMaxRetry = 3; private ISendAsync pipeline; private ISendAsyncTerminalFactory terminal; private List steps = new List(); @@ -92,6 +95,111 @@ public HttpPipeline(ISendAsyncTerminalFactory terminalStep) /// public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + private bool shouldRetry429(HttpResponseMessage response) + { + if (response.StatusCode == (System.Net.HttpStatusCode)429) + { + var retryAfter = response.Headers.RetryAfter; + if (retryAfter != null && retryAfter.Delta.HasValue) + { + return true; + } + } + return false; + } + /// + /// The step to handle 429 response with retry-after header. + /// + public async Task Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = int.MaxValue; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetry429(response) && count++ < retryCount) + { + request = await cloneRequest.CloneWithContent(); + var retryAfter = response.Headers.RetryAfter; + await Task.Delay(retryAfter.Delta.Value, callback.Token); + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds."); + response = await next.SendAsync(request, callback); + } + return response; + } + + private bool shouldRetryError(HttpResponseMessage response) + { + if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented && + response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported) + { + return true; + } + } + else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout) + { + return true; + } + else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null) + { + return true; + } + return false; + } + + /// + /// Returns true if status code in HttpRequestExceptionWithStatus exception is greater + /// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505). + /// Or it's 429 (TOO MANY REQUESTS) without Retry-After header. + /// + public async Task RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = DefaultMaxRetry; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetryError(response) && count++ < retryCount) + { + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}"); + request = await cloneRequest.CloneWithContent(); + response = await next.SendAsync(request, callback); + } + return response; + } + public ISendAsyncTerminalFactory TerminalFactory { get => terminal; @@ -117,6 +225,11 @@ public ISendAsync Pipeline // create the pipeline from scratch. var next = terminal.Create(); + if (Convert.ToBoolean(@"true")) + { + next = (new SendAsyncFactory(Retry429)).Create(next) ?? next; + next = (new SendAsyncFactory(RetryError)).Create(next) ?? next; + } foreach (var factory in steps) { // skip factories that return null. diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/InfoAttribute.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/InfoAttribute.cs index 2dac8be96913..15d6e1494c32 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/InfoAttribute.cs @@ -11,6 +11,9 @@ public class InfoAttribute : Attribute { public bool Required { get; set; } = false; public bool ReadOnly { get; set; } = false; + public bool Read { get; set; } = true; + public bool Create { get; set; } = true; + public bool Update { get; set; } = true; public Type[] PossibleTypes { get; set; } = new Type[0]; public string Description { get; set; } = ""; public string SerializedName { get; set; } = ""; @@ -30,5 +33,6 @@ public class DefaultInfoAttribute : Attribute public string Script { get; set; } = ""; public string Name { get; set; } = ""; public string Description { get; set; } = ""; + public string SetCondition { get; set; } = ""; } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/InputHandler.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..078b18b487a5 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/InputHandler.cs @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.Cmdlets +{ + public abstract class InputHandler + { + protected InputHandler NextHandler = null; + + public void SetNextHandler(InputHandler nextHandler) + { + this.NextHandler = nextHandler; + } + + public abstract void Process(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 398770cffd00..dfe5824baeca 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -21,6 +21,11 @@ internal XNodeArray(params JsonNode[] values) items = new List(values); } + internal XNodeArray(System.Collections.Generic.List values) + { + items = new List(values); + } + public override JsonNode this[int index] => items[index]; internal override JsonType? ElementType => null; diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/SerializationMode.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/SerializationMode.cs index 4de27f0738f1..3b81226d80c0 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/SerializationMode.cs @@ -9,8 +9,10 @@ public enum SerializationMode { None = 0, IncludeHeaders = 1 << 0, - IncludeReadOnly = 1 << 1, - - IncludeAll = IncludeHeaders | IncludeReadOnly + IncludeRead = 1 << 1, + IncludeCreate = 1 << 2, + IncludeUpdate = 1 << 3, + IncludeAll = IncludeHeaders | IncludeRead | IncludeCreate | IncludeUpdate, + IncludeCreateOrUpdate = IncludeCreate | IncludeUpdate } } \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Reservations/Reservations.Autorest/generated/runtime/TypeConverterExtensions.cs index 6bdf6b7fa243..6ea00126d87f 100644 --- a/generated/Reservations/Reservations.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Reservations/Reservations.Autorest/generated/runtime/TypeConverterExtensions.cs @@ -62,6 +62,56 @@ internal static T[] SelectToArray(object source, System.Func return result.ToArray(); } + internal static System.Collections.Generic.List SelectToList(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }.ToList(); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0].ToList(); // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result; + } internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) { if (null != dictionary) diff --git a/generated/Reservations/Reservations.Autorest/internal/Get-AzReservationsOperation.ps1 b/generated/Reservations/Reservations.Autorest/internal/Get-AzReservationsOperation.ps1 index 530b0344e6e9..4188b59052ae 100644 --- a/generated/Reservations/Reservations.Autorest/internal/Get-AzReservationsOperation.ps1 +++ b/generated/Reservations/Reservations.Autorest/internal/Get-AzReservationsOperation.ps1 @@ -25,12 +25,12 @@ List all the operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationsoperation #> function Get-AzReservationsOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.Reservations.private\Get-AzReservationsOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/internal/Invoke-AzReservationReturn.ps1 b/generated/Reservations/Reservations.Autorest/internal/Invoke-AzReservationReturn.ps1 index 5f0f7875dc3a..fca348b6327c 100644 --- a/generated/Reservations/Reservations.Autorest/internal/Invoke-AzReservationReturn.ps1 +++ b/generated/Reservations/Reservations.Autorest/internal/Invoke-AzReservationReturn.ps1 @@ -26,24 +26,15 @@ $fullyQualifiedOrderId = "/providers/microsoft.capacity/reservationOrders/500000 Invoke-AzReservationCalculateRefund -ReservationOrderId $orderId -ReservationToReturnQuantity 1 -ReservationToReturnReservationId $fullyQualifiedId -Id $fullyQualifiedOrderId -Scope "Reservation" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse .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. -BODY : Request containing information needed for returning reservation. - [ReservationToReturnQuantity ]: Quantity to be returned. Must be greater than zero. - [ReservationToReturnReservationId ]: Fully qualified identifier of the reservation being returned - [ReturnReason ]: The reason of returning the reservation - [Scope ]: The scope of the refund, e.g. Reservation - [SessionId ]: SessionId that was returned by CalculateRefund API. - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -53,32 +44,23 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationreturn #> function Invoke-AzReservationReturn { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse])] [CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Post', Mandatory)] [Parameter(ParameterSetName='PostExpanded', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${ReservationOrderId}, - [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Post', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest] - # Request containing information needed for returning reservation. - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='PostExpanded')] [Parameter(ParameterSetName='PostViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] @@ -116,6 +98,18 @@ param( # SessionId that was returned by CalculateRefund API. ${SessionId}, + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Post operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Post operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -184,15 +178,21 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Post = 'Az.Reservations.private\Invoke-AzReservationReturn_Post'; PostExpanded = 'Az.Reservations.private\Invoke-AzReservationReturn_PostExpanded'; - PostViaIdentity = 'Az.Reservations.private\Invoke-AzReservationReturn_PostViaIdentity'; PostViaIdentityExpanded = 'Az.Reservations.private\Invoke-AzReservationReturn_PostViaIdentityExpanded'; + PostViaJsonFilePath = 'Az.Reservations.private\Invoke-AzReservationReturn_PostViaJsonFilePath'; + PostViaJsonString = 'Az.Reservations.private\Invoke-AzReservationReturn_PostViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/internal/Merge-AzReservation.ps1 b/generated/Reservations/Reservations.Autorest/internal/Merge-AzReservation.ps1 index a3bb326d20fb..6a8e882841f7 100644 --- a/generated/Reservations/Reservations.Autorest/internal/Merge-AzReservation.ps1 +++ b/generated/Reservations/Reservations.Autorest/internal/Merge-AzReservation.ps1 @@ -26,18 +26,18 @@ $arr=@("72bc398d-b201-4a2e-a1fa-60fb48a85b23", "34f2474f-b4d7-41ec-a96d-d4bb7c2f Merge-AzReservation -ReservationOrderId "79ebddac-4030-4296-ab93-1ad90f032058" -ReservationId $arr .Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .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. BODY : The request for reservation merge - [Source ]: Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} + [Source >]: Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} INPUTOBJECT : Identity Parameter [Id ]: Resource identity path @@ -48,11 +48,13 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/merge-azreservation #> function Merge-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(DefaultParameterSetName='MergeExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Merge', Mandatory)] [Parameter(ParameterSetName='MergeExpanded', Mandatory)] + [Parameter(ParameterSetName='MergeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='MergeViaJsonString', Mandatory)] [Alias('ReservationOrderId')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] @@ -64,15 +66,13 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Merge', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='MergeViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest] # The request for reservation merge - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='MergeExpanded')] @@ -83,6 +83,18 @@ param( # Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} ${ReservationId}, + [Parameter(ParameterSetName='MergeViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Merge operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='MergeViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Merge operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -151,15 +163,23 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Merge = 'Az.Reservations.private\Merge-AzReservation_Merge'; MergeExpanded = 'Az.Reservations.private\Merge-AzReservation_MergeExpanded'; MergeViaIdentity = 'Az.Reservations.private\Merge-AzReservation_MergeViaIdentity'; MergeViaIdentityExpanded = 'Az.Reservations.private\Merge-AzReservation_MergeViaIdentityExpanded'; + MergeViaJsonFilePath = 'Az.Reservations.private\Merge-AzReservation_MergeViaJsonFilePath'; + MergeViaJsonString = 'Az.Reservations.private\Merge-AzReservation_MergeViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/Reservations/Reservations.Autorest/internal/ProxyCmdletDefinitions.ps1 index b9dec240611e..a59eee318745 100644 --- a/generated/Reservations/Reservations.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/Reservations/Reservations.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -25,12 +25,12 @@ List all the operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse .Link https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationsoperation #> function Get-AzReservationsOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IOperationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IOperationResponse])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.Reservations.private\Get-AzReservationsOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -136,24 +142,15 @@ $fullyQualifiedOrderId = "/providers/microsoft.capacity/reservationOrders/500000 Invoke-AzReservationCalculateRefund -ReservationOrderId $orderId -ReservationToReturnQuantity 1 -ReservationToReturnReservationId $fullyQualifiedId -Id $fullyQualifiedOrderId -Scope "Reservation" -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse .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. -BODY : Request containing information needed for returning reservation. - [ReservationToReturnQuantity ]: Quantity to be returned. Must be greater than zero. - [ReservationToReturnReservationId ]: Fully qualified identifier of the reservation being returned - [ReturnReason ]: The reason of returning the reservation - [Scope ]: The scope of the refund, e.g. Reservation - [SessionId ]: SessionId that was returned by CalculateRefund API. - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -163,32 +160,23 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/invoke-azreservationreturn #> function Invoke-AzReservationReturn { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationOrderResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationOrderResponse])] [CmdletBinding(DefaultParameterSetName='PostExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Post', Mandatory)] [Parameter(ParameterSetName='PostExpanded', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${ReservationOrderId}, - [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='PostViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Post', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='PostViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IRefundRequest] - # Request containing information needed for returning reservation. - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='PostExpanded')] [Parameter(ParameterSetName='PostViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] @@ -226,6 +214,18 @@ param( # SessionId that was returned by CalculateRefund API. ${SessionId}, + [Parameter(ParameterSetName='PostViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Post operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PostViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Post operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -294,15 +294,21 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Post = 'Az.Reservations.private\Invoke-AzReservationReturn_Post'; PostExpanded = 'Az.Reservations.private\Invoke-AzReservationReturn_PostExpanded'; - PostViaIdentity = 'Az.Reservations.private\Invoke-AzReservationReturn_PostViaIdentity'; PostViaIdentityExpanded = 'Az.Reservations.private\Invoke-AzReservationReturn_PostViaIdentityExpanded'; + PostViaJsonFilePath = 'Az.Reservations.private\Invoke-AzReservationReturn_PostViaJsonFilePath'; + PostViaJsonString = 'Az.Reservations.private\Invoke-AzReservationReturn_PostViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -344,18 +350,18 @@ $arr=@("72bc398d-b201-4a2e-a1fa-60fb48a85b23", "34f2474f-b4d7-41ec-a96d-d4bb7c2f Merge-AzReservation -ReservationOrderId "79ebddac-4030-4296-ab93-1ad90f032058" -ReservationId $arr .Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .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. BODY : The request for reservation merge - [Source ]: Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} + [Source >]: Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} INPUTOBJECT : Identity Parameter [Id ]: Resource identity path @@ -366,11 +372,13 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/merge-azreservation #> function Merge-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(DefaultParameterSetName='MergeExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Merge', Mandatory)] [Parameter(ParameterSetName='MergeExpanded', Mandatory)] + [Parameter(ParameterSetName='MergeViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='MergeViaJsonString', Mandatory)] [Alias('ReservationOrderId')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] @@ -382,15 +390,13 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Merge', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='MergeViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IMergeRequest] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IMergeRequest] # The request for reservation merge - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='MergeExpanded')] @@ -401,6 +407,18 @@ param( # Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} ${ReservationId}, + [Parameter(ParameterSetName='MergeViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Merge operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='MergeViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Merge operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -469,15 +487,23 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Merge = 'Az.Reservations.private\Merge-AzReservation_Merge'; MergeExpanded = 'Az.Reservations.private\Merge-AzReservation_MergeExpanded'; MergeViaIdentity = 'Az.Reservations.private\Merge-AzReservation_MergeViaIdentity'; MergeViaIdentityExpanded = 'Az.Reservations.private\Merge-AzReservation_MergeViaIdentityExpanded'; + MergeViaJsonFilePath = 'Az.Reservations.private\Merge-AzReservation_MergeViaJsonFilePath'; + MergeViaJsonString = 'Az.Reservations.private\Merge-AzReservation_MergeViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -516,21 +542,15 @@ Split a `Reservation` into two `Reservation`s with specified quantity distributi Split-AzReservation -ReservationOrderId "c615c897-aaaa-4123-8527-c42cc0da41e0" -ReservationId "1bdfaf4a-159d-46ec-be3a-f4aa527d423c" -Quantity @(2,8) -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .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. -BODY : The request for reservation split - [Quantity ]: List of the quantities in the new reservations to create. - [ReservationId ]: Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -540,33 +560,24 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/split-azreservation #> function Split-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(DefaultParameterSetName='SplitExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Split', Mandatory)] [Parameter(ParameterSetName='SplitExpanded', Mandatory)] + [Parameter(ParameterSetName='SplitViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='SplitViaJsonString', Mandatory)] [Alias('ReservationOrderId')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${OrderId}, - [Parameter(ParameterSetName='SplitViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='SplitViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Split', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='SplitViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest] - # The request for reservation split - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='SplitExpanded')] [Parameter(ParameterSetName='SplitViaIdentityExpanded')] [AllowEmptyCollection()] @@ -583,6 +594,18 @@ param( # Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} ${ReservationId}, + [Parameter(ParameterSetName='SplitViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Split operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='SplitViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Split operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -651,15 +674,21 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Split = 'Az.Reservations.private\Split-AzReservation_Split'; SplitExpanded = 'Az.Reservations.private\Split-AzReservation_SplitExpanded'; - SplitViaIdentity = 'Az.Reservations.private\Split-AzReservation_SplitViaIdentity'; SplitViaIdentityExpanded = 'Az.Reservations.private\Split-AzReservation_SplitViaIdentityExpanded'; + SplitViaJsonFilePath = 'Az.Reservations.private\Split-AzReservation_SplitViaJsonFilePath'; + SplitViaJsonString = 'Az.Reservations.private\Split-AzReservation_SplitViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/internal/Split-AzReservation.ps1 b/generated/Reservations/Reservations.Autorest/internal/Split-AzReservation.ps1 index 709fbbec5404..1de6594bbecc 100644 --- a/generated/Reservations/Reservations.Autorest/internal/Split-AzReservation.ps1 +++ b/generated/Reservations/Reservations.Autorest/internal/Split-AzReservation.ps1 @@ -23,21 +23,15 @@ Split a `Reservation` into two `Reservation`s with specified quantity distributi Split-AzReservation -ReservationOrderId "c615c897-aaaa-4123-8527-c42cc0da41e0" -ReservationId "1bdfaf4a-159d-46ec-be3a-f4aa527d423c" -Quantity @(2,8) -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest .Inputs Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse +Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse .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. -BODY : The request for reservation split - [Quantity ]: List of the quantities in the new reservations to create. - [ReservationId ]: Resource id of the reservation to be split. Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} - INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [ReservationId ]: Id of the reservation item @@ -47,33 +41,24 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.reservations/split-azreservation #> function Split-AzReservation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])] [CmdletBinding(DefaultParameterSetName='SplitExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Split', Mandatory)] [Parameter(ParameterSetName='SplitExpanded', Mandatory)] + [Parameter(ParameterSetName='SplitViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='SplitViaJsonString', Mandatory)] [Alias('ReservationOrderId')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [System.String] # Order Id of the reservation ${OrderId}, - [Parameter(ParameterSetName='SplitViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='SplitViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(ParameterSetName='Split', Mandatory, ValueFromPipeline)] - [Parameter(ParameterSetName='SplitViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISplitRequest] - # The request for reservation split - # To construct, see NOTES section for BODY properties and create a hash table. - ${Body}, - [Parameter(ParameterSetName='SplitExpanded')] [Parameter(ParameterSetName='SplitViaIdentityExpanded')] [AllowEmptyCollection()] @@ -90,6 +75,18 @@ param( # Format of the resource id should be /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} ${ReservationId}, + [Parameter(ParameterSetName='SplitViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Path of Json file supplied to the Split operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='SplitViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.String] + # Json string supplied to the Split operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -158,15 +155,21 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ - Split = 'Az.Reservations.private\Split-AzReservation_Split'; SplitExpanded = 'Az.Reservations.private\Split-AzReservation_SplitExpanded'; - SplitViaIdentity = 'Az.Reservations.private\Split-AzReservation_SplitViaIdentity'; SplitViaIdentityExpanded = 'Az.Reservations.private\Split-AzReservation_SplitViaIdentityExpanded'; + SplitViaJsonFilePath = 'Az.Reservations.private\Split-AzReservation_SplitViaJsonFilePath'; + SplitViaJsonString = 'Az.Reservations.private\Split-AzReservation_SplitViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/Reservations/Reservations.Autorest/resources/README.md b/generated/Reservations/Reservations.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/Reservations/Reservations.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/generated/Reservations/Reservations.Autorest/test-module.ps1 b/generated/Reservations/Reservations.Autorest/test-module.ps1 index 09e32b63d5f7..b170f9dc80d9 100644 --- a/generated/Reservations/Reservations.Autorest/test-module.ps1 +++ b/generated/Reservations/Reservations.Autorest/test-module.ps1 @@ -12,17 +12,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +param([switch]$NotIsolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) $ErrorActionPreference = 'Stop' -if(-not $Isolated) +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' if ($PSBoundParameters.ContainsKey("TestName")) { $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," } $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } @@ -34,7 +34,7 @@ if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and $ProgressPreference = 'SilentlyContinue' $baseName = $PSScriptRoot.BaseName $requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) -. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -NotIsolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule . ("$PSScriptRoot\test\utils.ps1") if ($requireResourceModule) @@ -95,4 +95,4 @@ try } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------'