From 949e619ff04b59a540a4a37b7dda4a86fcc80857 Mon Sep 17 00:00:00 2001 From: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:09:18 +0000 Subject: [PATCH] [skip ci] Archive Schedule --- .../Az.MarketplaceOrdering.csproj | 2 +- .../Az.MarketplaceOrdering.format.ps1xml | 224 +-- .../Az.MarketplaceOrdering.psd1 | 3 +- .../Properties/AssemblyInfo.cs | 30 +- .../check-dependencies.ps1 | 6 +- .../exports/Get-AzMarketplaceTerms.ps1 | 24 +- .../exports/Invoke-AzMarketplaceSignTerms.ps1 | 56 +- .../exports/ProxyCmdletDefinitions.ps1 | 167 +- .../exports/Set-AzMarketplaceTerms.ps1 | 31 +- .../exports/Stop-AzMarketplaceTerms.ps1 | 56 +- .../generate-info.json | 2 +- .../generated/Module.cs | 27 +- .../generated/api/MarketplaceOrdering.cs | 1543 +++++++++++++++-- .../AgreementProperties.PowerShell.cs | 58 +- .../AgreementProperties.TypeConverter.cs | 6 +- .../{Api202101 => }/AgreementProperties.cs | 33 +- .../AgreementProperties.json.cs | 26 +- .../api/Models/AgreementTerms.PowerShell.cs | 316 ++++ .../AgreementTerms.TypeConverter.cs | 6 +- .../Models/{Api202101 => }/AgreementTerms.cs | 176 +- .../{Api202101 => }/AgreementTerms.json.cs | 16 +- .../Api202101/AgreementTerms.PowerShell.cs | 316 ---- .../ErrorResponse.PowerShell.cs | 32 +- .../ErrorResponse.TypeConverter.cs | 6 +- .../Models/{Api202101 => }/ErrorResponse.cs | 28 +- .../{Api202101 => }/ErrorResponse.json.cs | 10 +- .../ErrorResponseError.PowerShell.cs | 30 +- .../ErrorResponseError.TypeConverter.cs | 6 +- .../{Api202101 => }/ErrorResponseError.cs | 16 +- .../ErrorResponseError.json.cs | 16 +- .../MarketplaceOrderingIdentity.PowerShell.cs | 4 +- .../api/Models/MarketplaceOrderingIdentity.cs | 30 +- .../MarketplaceOrderingIdentity.json.cs | 12 +- .../{Api202101 => }/Operation.PowerShell.cs | 44 +- .../Operation.TypeConverter.cs | 6 +- .../api/Models/{Api202101 => }/Operation.cs | 37 +- .../Models/{Api202101 => }/Operation.json.cs | 12 +- .../OperationDisplay.PowerShell.cs | 36 +- .../OperationDisplay.TypeConverter.cs | 6 +- .../{Api202101 => }/OperationDisplay.cs | 18 +- .../{Api202101 => }/OperationDisplay.json.cs | 16 +- .../OperationListResult.PowerShell.cs | 30 +- .../OperationListResult.TypeConverter.cs | 6 +- .../{Api202101 => }/OperationListResult.cs | 24 +- .../OperationListResult.json.cs | 14 +- .../{Api202101 => }/Resource.PowerShell.cs | 32 +- .../{Api202101 => }/Resource.TypeConverter.cs | 6 +- .../api/Models/{Api202101 => }/Resource.cs | 21 +- .../Models/{Api202101 => }/Resource.json.cs | 20 +- .../{Api20 => }/SystemData.PowerShell.cs | 44 +- .../{Api20 => }/SystemData.TypeConverter.cs | 6 +- .../api/Models/{Api20 => }/SystemData.cs | 48 +- .../api/Models/{Api20 => }/SystemData.json.cs | 20 +- .../api/Support/CreatedByType.Completer.cs | 47 - .../Support/CreatedByType.TypeConverter.cs | 59 - .../generated/api/Support/CreatedByType.cs | 102 -- .../api/Support/OfferType.Completer.cs | 35 - .../api/Support/OfferType.TypeConverter.cs | 59 - .../generated/api/Support/OfferType.cs | 95 - .../cmdlets/GetAzMarketplaceOperation_List.cs | 112 +- .../cmdlets/GetAzMarketplaceTerms_Get.cs | 112 +- .../cmdlets/GetAzMarketplaceTerms_Get1.cs | 112 +- .../InvokeAzMarketplaceSignTerms_Sign.cs | 112 +- ...eAzMarketplaceSignTerms_SignViaIdentity.cs | 105 +- ...placeSignTerms_SignViaIdentityAgreement.cs | 513 ++++++ ...rketplaceSignTerms_SignViaIdentityOffer.cs | 503 ++++++ .../cmdlets/SetAzMarketplaceTerms_Create.cs | 121 +- .../cmdlets/StopAzMarketplaceTerms_Cancel.cs | 112 +- ...topAzMarketplaceTerms_CancelViaIdentity.cs | 105 +- ...etplaceTerms_CancelViaIdentityAgreement.cs | 513 ++++++ ...MarketplaceTerms_CancelViaIdentityOffer.cs | 503 ++++++ .../Attributes/ExternalDocsAttribute.cs | 30 + .../PSArgumentCompleterAttribute.cs | 52 + .../BuildTime/Cmdlets/ExportFormatPs1xml.cs | 6 +- .../BuildTime/Cmdlets/ExportModelSurface.cs | 2 +- .../BuildTime/Cmdlets/ExportProxyCmdlet.cs | 4 +- .../runtime/BuildTime/Cmdlets/ExportPsd1.cs | 8 +- .../BuildTime/Cmdlets/ExportTestStub.cs | 211 ++- .../runtime/BuildTime/MarkdownRenderer.cs | 2 +- .../BuildTime/Models/PsMarkdownTypes.cs | 43 +- .../BuildTime/Models/PsProxyOutputs.cs | 60 +- .../runtime/BuildTime/Models/PsProxyTypes.cs | 56 +- .../runtime/BuildTime/PsAttributes.cs | 15 + .../runtime/BuildTime/PsExtensions.cs | 7 + .../generated/runtime/BuildTime/PsHelpers.cs | 4 +- .../generated/runtime/Context.cs | 33 + .../generated/runtime/Events.cs | 4 +- .../generated/runtime/ISendAsync.cs | 113 ++ .../generated/runtime/InfoAttribute.cs | 4 + .../generated/runtime/InputHandler.cs | 22 + .../runtime/Nodes/Collections/XNodeArray.cs | 5 + .../generated/runtime/SerializationMode.cs | 8 +- .../runtime/TypeConverterExtensions.cs | 50 + .../internal/Get-AzMarketplaceOperation.ps1 | 10 +- .../internal/Get-AzMarketplaceTerms.ps1 | 14 +- .../internal/ProxyCmdletDefinitions.ps1 | 49 +- .../internal/Set-AzMarketplaceTerms.ps1 | 25 +- .../resources/README.md | 11 + .../test-module.ps1 | 10 +- 99 files changed, 6141 insertions(+), 1797 deletions(-) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/AgreementProperties.PowerShell.cs (62%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/AgreementProperties.TypeConverter.cs (97%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/AgreementProperties.cs (93%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/AgreementProperties.json.cs (93%) create mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.PowerShell.cs rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/AgreementTerms.TypeConverter.cs (97%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/AgreementTerms.cs (63%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/AgreementTerms.json.cs (93%) delete mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.PowerShell.cs rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/ErrorResponse.PowerShell.cs (76%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/ErrorResponse.TypeConverter.cs (97%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/ErrorResponse.cs (72%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/ErrorResponse.json.cs (95%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseError.PowerShell.cs (80%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseError.TypeConverter.cs (97%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseError.cs (88%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseError.json.cs (95%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/Operation.PowerShell.cs (68%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/Operation.TypeConverter.cs (97%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/Operation.cs (77%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/Operation.json.cs (94%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/OperationDisplay.PowerShell.cs (74%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/OperationDisplay.TypeConverter.cs (97%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/OperationDisplay.cs (93%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/OperationDisplay.json.cs (96%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/OperationListResult.PowerShell.cs (76%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/OperationListResult.TypeConverter.cs (97%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/OperationListResult.cs (80%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/OperationListResult.json.cs (91%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/Resource.PowerShell.cs (78%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/Resource.TypeConverter.cs (97%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/Resource.cs (88%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api202101 => }/Resource.json.cs (94%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api20 => }/SystemData.PowerShell.cs (65%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api20 => }/SystemData.TypeConverter.cs (97%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api20 => }/SystemData.cs (80%) rename generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/{Api20 => }/SystemData.json.cs (95%) delete mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/CreatedByType.Completer.cs delete mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs delete mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/CreatedByType.cs delete mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.Completer.cs delete mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.TypeConverter.cs delete mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.cs create mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentityAgreement.cs create mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentityOffer.cs create mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentityAgreement.cs create mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentityOffer.cs create mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs create mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs create mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Context.cs create mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/InputHandler.cs create mode 100644 generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/resources/README.md diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.csproj b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.csproj index 3999049ba1cb..e6da0ecab848 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.csproj +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.csproj @@ -2,9 +2,9 @@ MarketplaceOrdering MarketplaceOrdering + MarketplaceOrdering.Autorest - diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.format.ps1xml b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.format.ps1xml index 0cbeb12895e3..3a9a09f70642 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.format.ps1xml +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.format.ps1xml @@ -2,107 +2,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.MarketplaceOrderingIdentity - - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.MarketplaceOrderingIdentity - - - - - - - - - - - - - - - - - - - - - - - - OfferId - - - OfferType - - - PlanId - - - PublisherId - - - SubscriptionId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.SystemData - - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.SystemData - - - - - - - - - - - - - - - - - - - - - - - - - - - CreatedAt - - - CreatedBy - - - CreatedByType - - - LastModifiedAt - - - LastModifiedBy - - - LastModifiedByType - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementProperties + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementProperties - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementProperties + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementProperties#Multiple @@ -170,9 +72,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementTerms + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementTerms + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms#Multiple @@ -222,9 +124,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponseError + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponseError - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponseError + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponseError#Multiple @@ -250,9 +152,55 @@ - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.Operation + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.MarketplaceOrderingIdentity + + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.MarketplaceOrderingIdentity#Multiple + + + + + + + + + + + + + + + + + + + + + + + + OfferId + + + OfferType + + + PlanId + + + PublisherId + + + SubscriptionId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Operation - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.Operation + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Operation#Multiple @@ -272,9 +220,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationDisplay#Multiple @@ -312,9 +260,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationListResult - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationListResult + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationListResult#Multiple @@ -334,9 +282,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.Resource + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.Resource + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Resource#Multiple @@ -355,5 +303,57 @@ + + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.SystemData + + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.SystemData#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + CreatedAt + + + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType + + + + + + \ No newline at end of file diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.psd1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.psd1 index 14e99b6331ac..82f5f4df5a74 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.psd1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Az.MarketplaceOrdering.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.MarketplaceOrdering.private.dll' FormatsToProcess = './Az.MarketplaceOrdering.format.ps1xml' - FunctionsToExport = 'Get-AzMarketplaceTerms', 'Invoke-AzMarketplaceSignTerms', 'Set-AzMarketplaceTerms', 'Stop-AzMarketplaceTerms', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzMarketplaceTerms', 'Invoke-AzMarketplaceSignTerms', 'Set-AzMarketplaceTerms', 'Stop-AzMarketplaceTerms' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'MarketplaceOrdering' diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Properties/AssemblyInfo.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Properties/AssemblyInfo.cs index 3dba8a2a490b..0e559d2f4088 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Properties/AssemblyInfo.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,26 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the Apache License, Version 2.0 (the ""License""); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, +// distributed under the License is distributed on an ""AS IS"" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// ---------------------------------------------------------------------------------- +// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +// is regenerated. using System; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -[assembly: AssemblyTitle("Microsoft Azure Powershell - MarketplaceOrdering")] -[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] -[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] -[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] - -[assembly: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("7d088a9b-8607-40d4-9af9-04d57df1d972")] -[assembly: AssemblyVersion("2.1.0")] -[assembly: AssemblyFileVersion("2.1.0")] +[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 - MarketplaceOrdering")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("2.1.0")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/check-dependencies.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/check-dependencies.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Get-AzMarketplaceTerms.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Get-AzMarketplaceTerms.ps1 index 72a2783646e2..93fb6fa1718d 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Get-AzMarketplaceTerms.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Get-AzMarketplaceTerms.ps1 @@ -27,12 +27,12 @@ Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-scienc .Inputs Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Link https://learn.microsoft.com/powershell/module/az.marketplaceordering/get-azmarketplaceterms #> function Get-AzMarketplaceTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='Get1', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -61,9 +61,9 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Get', Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType])] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PSArgumentCompleterAttribute("virtualmachine")] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType] + [System.String] # Publisher identifier string of image being deployed. ${OfferType}, @@ -122,6 +122,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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() @@ -144,9 +153,7 @@ begin { Get1 = 'Az.MarketplaceOrdering.custom\Get-AzMarketplaceTerms'; Get = 'Az.MarketplaceOrdering.custom\Get-AzMarketplaceTerms'; } - if (('Get1', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get1', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -160,6 +167,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Invoke-AzMarketplaceSignTerms.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Invoke-AzMarketplaceSignTerms.ps1 index 36964e511087..1a777e5966b7 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Invoke-AzMarketplaceSignTerms.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Invoke-AzMarketplaceSignTerms.ps1 @@ -27,16 +27,32 @@ Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science .Inputs Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .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. +AGREEMENTINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OfferId ]: Offer identifier string of image being deployed. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [PlanId ]: Plan identifier string of image being deployed. + [PublisherId ]: Publisher identifier string of image being deployed. + [SubscriptionId ]: The subscription ID that identifies an Azure subscription. + INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [OfferId ]: Offer identifier string of image being deployed. - [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [PlanId ]: Plan identifier string of image being deployed. + [PublisherId ]: Publisher identifier string of image being deployed. + [SubscriptionId ]: The subscription ID that identifies an Azure subscription. + +OFFERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OfferId ]: Offer identifier string of image being deployed. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. [PlanId ]: Plan identifier string of image being deployed. [PublisherId ]: Publisher identifier string of image being deployed. [SubscriptionId ]: The subscription ID that identifies an Azure subscription. @@ -44,16 +60,19 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.marketplaceordering/invoke-azmarketplacesignterms #> function Invoke-AzMarketplaceSignTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='Sign', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Sign', Mandatory)] + [Parameter(ParameterSetName='SignViaIdentityAgreement', Mandatory)] + [Parameter(ParameterSetName='SignViaIdentityOffer', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [System.String] # Plan identifier string of image being deployed. ${Name}, [Parameter(ParameterSetName='Sign', Mandatory)] + [Parameter(ParameterSetName='SignViaIdentityAgreement', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [System.String] # Offer identifier string of image being deployed. @@ -76,9 +95,20 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='SignViaIdentityAgreement', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] + # Identity Parameter + ${AgreementInputObject}, + + [Parameter(ParameterSetName='SignViaIdentityOffer', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] + # Identity Parameter + ${OfferInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -135,6 +165,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -156,10 +195,10 @@ begin { $mapping = @{ Sign = 'Az.MarketplaceOrdering.private\Invoke-AzMarketplaceSignTerms_Sign'; SignViaIdentity = 'Az.MarketplaceOrdering.private\Invoke-AzMarketplaceSignTerms_SignViaIdentity'; + SignViaIdentityAgreement = 'Az.MarketplaceOrdering.private\Invoke-AzMarketplaceSignTerms_SignViaIdentityAgreement'; + SignViaIdentityOffer = 'Az.MarketplaceOrdering.private\Invoke-AzMarketplaceSignTerms_SignViaIdentityOffer'; } - if (('Sign') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Sign') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -173,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/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/ProxyCmdletDefinitions.ps1 index c8ffd30c4052..bbe117a925af 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -27,16 +27,32 @@ Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science .Inputs Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .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. +AGREEMENTINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OfferId ]: Offer identifier string of image being deployed. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [PlanId ]: Plan identifier string of image being deployed. + [PublisherId ]: Publisher identifier string of image being deployed. + [SubscriptionId ]: The subscription ID that identifies an Azure subscription. + INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [OfferId ]: Offer identifier string of image being deployed. - [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [PlanId ]: Plan identifier string of image being deployed. + [PublisherId ]: Publisher identifier string of image being deployed. + [SubscriptionId ]: The subscription ID that identifies an Azure subscription. + +OFFERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OfferId ]: Offer identifier string of image being deployed. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. [PlanId ]: Plan identifier string of image being deployed. [PublisherId ]: Publisher identifier string of image being deployed. [SubscriptionId ]: The subscription ID that identifies an Azure subscription. @@ -44,16 +60,19 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.marketplaceordering/invoke-azmarketplacesignterms #> function Invoke-AzMarketplaceSignTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='Sign', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Sign', Mandatory)] + [Parameter(ParameterSetName='SignViaIdentityAgreement', Mandatory)] + [Parameter(ParameterSetName='SignViaIdentityOffer', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [System.String] # Plan identifier string of image being deployed. ${Name}, [Parameter(ParameterSetName='Sign', Mandatory)] + [Parameter(ParameterSetName='SignViaIdentityAgreement', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [System.String] # Offer identifier string of image being deployed. @@ -76,9 +95,20 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='SignViaIdentityAgreement', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] + # Identity Parameter + ${AgreementInputObject}, + + [Parameter(ParameterSetName='SignViaIdentityOffer', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] + # Identity Parameter + ${OfferInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -135,6 +165,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -156,10 +195,10 @@ begin { $mapping = @{ Sign = 'Az.MarketplaceOrdering.private\Invoke-AzMarketplaceSignTerms_Sign'; SignViaIdentity = 'Az.MarketplaceOrdering.private\Invoke-AzMarketplaceSignTerms_SignViaIdentity'; + SignViaIdentityAgreement = 'Az.MarketplaceOrdering.private\Invoke-AzMarketplaceSignTerms_SignViaIdentityAgreement'; + SignViaIdentityOffer = 'Az.MarketplaceOrdering.private\Invoke-AzMarketplaceSignTerms_SignViaIdentityOffer'; } - if (('Sign') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Sign') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -173,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) @@ -229,16 +271,32 @@ Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science .Inputs Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .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. +AGREEMENTINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OfferId ]: Offer identifier string of image being deployed. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [PlanId ]: Plan identifier string of image being deployed. + [PublisherId ]: Publisher identifier string of image being deployed. + [SubscriptionId ]: The subscription ID that identifies an Azure subscription. + INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [OfferId ]: Offer identifier string of image being deployed. - [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [PlanId ]: Plan identifier string of image being deployed. + [PublisherId ]: Publisher identifier string of image being deployed. + [SubscriptionId ]: The subscription ID that identifies an Azure subscription. + +OFFERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OfferId ]: Offer identifier string of image being deployed. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. [PlanId ]: Plan identifier string of image being deployed. [PublisherId ]: Publisher identifier string of image being deployed. [SubscriptionId ]: The subscription ID that identifies an Azure subscription. @@ -246,16 +304,19 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.marketplaceordering/stop-azmarketplaceterms #> function Stop-AzMarketplaceTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='Cancel', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelViaIdentityAgreement', Mandatory)] + [Parameter(ParameterSetName='CancelViaIdentityOffer', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [System.String] # Plan identifier string of image being deployed. ${Name}, [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelViaIdentityAgreement', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [System.String] # Offer identifier string of image being deployed. @@ -278,9 +339,20 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='CancelViaIdentityAgreement', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] + # Identity Parameter + ${AgreementInputObject}, + + [Parameter(ParameterSetName='CancelViaIdentityOffer', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] + # Identity Parameter + ${OfferInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -337,6 +409,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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() @@ -358,10 +439,10 @@ begin { $mapping = @{ Cancel = 'Az.MarketplaceOrdering.private\Stop-AzMarketplaceTerms_Cancel'; CancelViaIdentity = 'Az.MarketplaceOrdering.private\Stop-AzMarketplaceTerms_CancelViaIdentity'; + CancelViaIdentityAgreement = 'Az.MarketplaceOrdering.private\Stop-AzMarketplaceTerms_CancelViaIdentityAgreement'; + CancelViaIdentityOffer = 'Az.MarketplaceOrdering.private\Stop-AzMarketplaceTerms_CancelViaIdentityOffer'; } - if (('Cancel') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Cancel') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -375,6 +456,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) @@ -431,12 +515,12 @@ Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-scienc .Inputs Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Link https://learn.microsoft.com/powershell/module/az.marketplaceordering/get-azmarketplaceterms #> function Get-AzMarketplaceTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='Get1', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -465,9 +549,9 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Get', Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType])] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PSArgumentCompleterAttribute("virtualmachine")] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType] + [System.String] # Publisher identifier string of image being deployed. ${OfferType}, @@ -526,6 +610,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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() @@ -548,9 +641,7 @@ begin { Get1 = 'Az.MarketplaceOrdering.custom\Get-AzMarketplaceTerms'; Get = 'Az.MarketplaceOrdering.custom\Get-AzMarketplaceTerms'; } - if (('Get1', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get1', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -564,6 +655,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) @@ -622,9 +716,9 @@ Set-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-scienc Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science-vm" -Name "windows2016" -OfferType 'virtualmachine' | Set-AzMarketplaceTerms -Reject .Inputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Notes COMPLEX PARAMETER PROPERTIES @@ -640,17 +734,11 @@ TERMS : Terms properties for provided Publisher/Offer/Plan tupl [Publisher ]: Publisher identifier string of image being deployed. [RetrieveDatetime ]: Date and time in UTC of when the terms were accepted. This is empty if Accepted is false. [Signature ]: Terms signature. - [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). - [SystemDataCreatedBy ]: The identity that created the resource. - [SystemDataCreatedByType ]: The type of identity that created the resource. - [SystemDataLastModifiedAt ]: The timestamp of resource last modification (UTC) - [SystemDataLastModifiedBy ]: The identity that last modified the resource. - [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. .Link https://learn.microsoft.com/powershell/module/az.marketplaceordering/set-azmarketplaceterms #> function Set-AzMarketplaceTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='TermsAccept', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='TermsAccept', Mandatory)] @@ -699,10 +787,9 @@ param( [Parameter(ParameterSetName='TermsAcceptViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='TermsRejectViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms] # Terms properties for provided Publisher/Offer/Plan tuple # To construct, see NOTES section for PARAMETER properties and create a hash table. - # To construct, see NOTES section for TERMS properties and create a hash table. ${Terms}, [Parameter()] @@ -760,6 +847,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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() @@ -784,9 +880,7 @@ begin { TermsAcceptViaIdentity = 'Az.MarketplaceOrdering.custom\Set-AzMarketplaceTerms'; TermsRejectViaIdentity = 'Az.MarketplaceOrdering.custom\Set-AzMarketplaceTerms'; } - if (('TermsAccept', 'TermsReject') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('TermsAccept', 'TermsReject') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -800,6 +894,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/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Set-AzMarketplaceTerms.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Set-AzMarketplaceTerms.ps1 index dab215a9c2cd..9f54296bfe20 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Set-AzMarketplaceTerms.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Set-AzMarketplaceTerms.ps1 @@ -29,9 +29,9 @@ Set-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-scienc Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science-vm" -Name "windows2016" -OfferType 'virtualmachine' | Set-AzMarketplaceTerms -Reject .Inputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Notes COMPLEX PARAMETER PROPERTIES @@ -47,17 +47,11 @@ TERMS : Terms properties for provided Publisher/Offer/Plan tupl [Publisher ]: Publisher identifier string of image being deployed. [RetrieveDatetime ]: Date and time in UTC of when the terms were accepted. This is empty if Accepted is false. [Signature ]: Terms signature. - [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). - [SystemDataCreatedBy ]: The identity that created the resource. - [SystemDataCreatedByType ]: The type of identity that created the resource. - [SystemDataLastModifiedAt ]: The timestamp of resource last modification (UTC) - [SystemDataLastModifiedBy ]: The identity that last modified the resource. - [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. .Link https://learn.microsoft.com/powershell/module/az.marketplaceordering/set-azmarketplaceterms #> function Set-AzMarketplaceTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='TermsAccept', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='TermsAccept', Mandatory)] @@ -106,10 +100,9 @@ param( [Parameter(ParameterSetName='TermsAcceptViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='TermsRejectViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms] # Terms properties for provided Publisher/Offer/Plan tuple # To construct, see NOTES section for PARAMETER properties and create a hash table. - # To construct, see NOTES section for TERMS properties and create a hash table. ${Terms}, [Parameter()] @@ -167,6 +160,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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() @@ -191,9 +193,7 @@ begin { TermsAcceptViaIdentity = 'Az.MarketplaceOrdering.custom\Set-AzMarketplaceTerms'; TermsRejectViaIdentity = 'Az.MarketplaceOrdering.custom\Set-AzMarketplaceTerms'; } - if (('TermsAccept', 'TermsReject') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('TermsAccept', 'TermsReject') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -207,6 +207,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/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Stop-AzMarketplaceTerms.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Stop-AzMarketplaceTerms.ps1 index 4584a13f110a..2de145a32b96 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Stop-AzMarketplaceTerms.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/exports/Stop-AzMarketplaceTerms.ps1 @@ -27,16 +27,32 @@ Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science .Inputs Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .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. +AGREEMENTINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OfferId ]: Offer identifier string of image being deployed. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [PlanId ]: Plan identifier string of image being deployed. + [PublisherId ]: Publisher identifier string of image being deployed. + [SubscriptionId ]: The subscription ID that identifies an Azure subscription. + INPUTOBJECT : Identity Parameter [Id ]: Resource identity path [OfferId ]: Offer identifier string of image being deployed. - [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. + [PlanId ]: Plan identifier string of image being deployed. + [PublisherId ]: Publisher identifier string of image being deployed. + [SubscriptionId ]: The subscription ID that identifies an Azure subscription. + +OFFERINPUTOBJECT : Identity Parameter + [Id ]: Resource identity path + [OfferId ]: Offer identifier string of image being deployed. + [OfferType ]: Offer Type, currently only virtualmachine type is supported. [PlanId ]: Plan identifier string of image being deployed. [PublisherId ]: Publisher identifier string of image being deployed. [SubscriptionId ]: The subscription ID that identifies an Azure subscription. @@ -44,16 +60,19 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.marketplaceordering/stop-azmarketplaceterms #> function Stop-AzMarketplaceTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='Cancel', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelViaIdentityAgreement', Mandatory)] + [Parameter(ParameterSetName='CancelViaIdentityOffer', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [System.String] # Plan identifier string of image being deployed. ${Name}, [Parameter(ParameterSetName='Cancel', Mandatory)] + [Parameter(ParameterSetName='CancelViaIdentityAgreement', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [System.String] # Offer identifier string of image being deployed. @@ -76,9 +95,20 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='CancelViaIdentityAgreement', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] + # Identity Parameter + ${AgreementInputObject}, + + [Parameter(ParameterSetName='CancelViaIdentityOffer', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity] + # Identity Parameter + ${OfferInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -135,6 +165,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -156,10 +195,10 @@ begin { $mapping = @{ Cancel = 'Az.MarketplaceOrdering.private\Stop-AzMarketplaceTerms_Cancel'; CancelViaIdentity = 'Az.MarketplaceOrdering.private\Stop-AzMarketplaceTerms_CancelViaIdentity'; + CancelViaIdentityAgreement = 'Az.MarketplaceOrdering.private\Stop-AzMarketplaceTerms_CancelViaIdentityAgreement'; + CancelViaIdentityOffer = 'Az.MarketplaceOrdering.private\Stop-AzMarketplaceTerms_CancelViaIdentityOffer'; } - if (('Cancel') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Cancel') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -173,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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generate-info.json b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generate-info.json index 1cbe7a36394f..f95f3e1917e7 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generate-info.json +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "b631a59e-9829-47e1-8d97-389622e100c5" + "generate_Id": "23545fce-cf16-4d10-b303-962956c5b572" } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/Module.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/Module.cs index a8d01b8ac21e..de9b28a35956 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/Module.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeli /// 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/MarketplaceOrdering.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/MarketplaceOrdering.cs index c4ad17cc6af5..fa06e19329e5 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/MarketplaceOrdering.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/MarketplaceOrdering.cs @@ -27,7 +27,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MarketplaceAgreementsCancel(string subscriptionId, string publisherId, string offerId, string planId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCancel(string subscriptionId, string publisherId, string offerId, string planId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -57,7 +57,7 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsCancel_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsCancel_Call (request, onOk,onDefault,eventListener,sender); } } @@ -71,7 +71,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MarketplaceAgreementsCancelViaIdentity(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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCancelViaIdentity(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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -82,7 +82,7 @@ public partial class MarketplaceOrdering var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.MarketplaceOrdering/agreements/(?[^/]+)/offers/(?[^/]+)/plans/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}'"); } // replace URI parameters with values from identity @@ -114,11 +114,173 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsCancel_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsCancel_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Cancel marketplace terms. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsCancelViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-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.MarketplaceOrdering/agreements/(?[^/]+)/offers/(?[^/]+)/plans/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var publisherId = _match.Groups["publisherId"].Value; + var offerId = _match.Groups["offerId"].Value; + var planId = _match.Groups["planId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.MarketplaceOrdering/agreements/" + + publisherId + + "/offers/" + + offerId + + "/plans/" + + planId + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsCancelWithResult_Call (request, eventListener,sender); + } + } + + /// Cancel marketplace terms. + /// The subscription ID that identifies an Azure subscription. + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsCancelWithResult(string subscriptionId, string publisherId, string offerId, string planId, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.MarketplaceOrdering/agreements/" + + global::System.Uri.EscapeDataString(publisherId) + + "/offers/" + + global::System.Uri.EscapeDataString(offerId) + + "/plans/" + + global::System.Uri.EscapeDataString(planId) + + "/cancel" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsCancelWithResult_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.MarketplaceOrdering.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 MarketplaceAgreementsCancelWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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 @@ -128,7 +290,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCancel_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCancel_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -139,6 +301,7 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -146,13 +309,13 @@ public partial class MarketplaceOrdering case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -201,13 +364,14 @@ public partial class MarketplaceOrdering /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsCreate(string subscriptionId, string publisherId, string offerId, string planId, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreate(string subscriptionId, string publisherId, string offerId, string planId, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-01-01"; var offerType = @"virtualmachine"; + var apiVersion = @"2021-01-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -237,11 +401,11 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsCreate_Call (request, onOk,onDefault,eventListener,sender); } } @@ -253,10 +417,11 @@ public partial class MarketplaceOrdering /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -271,8 +436,8 @@ public partial class MarketplaceOrdering } // replace URI parameters with values from identity - var offerType = _match.Groups["offerType"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; + var offerType = _match.Groups["offerType"].Value; var publisherId = _match.Groups["publisherId"].Value; var offerId = _match.Groups["offerId"].Value; var planId = _match.Groups["planId"].Value; @@ -302,94 +467,84 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsCreate_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsCreate_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). + /// Save marketplace terms. + /// + /// Parameters supplied to the Create Marketplace Terms operation. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsCreate_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms body, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-01-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.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.MarketplaceOrdering/offerTypes/(?[^/]+)/publishers/(?[^/]+)/offers/(?[^/]+)/plans/(?[^/]+)/agreements/current$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/{offerType}/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The subscription ID that identifies an Azure subscription. - /// Publisher identifier string of image being deployed. - /// Offer identifier string of image being deployed. - /// Plan identifier string of image being deployed. - /// Parameters supplied to the Create Marketplace Terms operation. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCreate_Validate(string subscriptionId, string publisherId, string offerId, string planId, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms body, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(publisherId),publisherId); - await eventListener.AssertNotNull(nameof(offerId),offerId); - await eventListener.AssertNotNull(nameof(planId),planId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var offerType = _match.Groups["offerType"].Value; + var publisherId = _match.Groups["publisherId"].Value; + var offerId = _match.Groups["offerId"].Value; + var planId = _match.Groups["planId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.MarketplaceOrdering/offerTypes/" + + offerType + + "/publishers/" + + publisherId + + "/offers/" + + offerId + + "/plans/" + + planId + + "/agreements/current" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsCreateWithResult_Call (request, eventListener,sender); } } - /// Get marketplace terms. + /// Save marketplace terms. /// The subscription ID that identifies an Azure subscription. /// Publisher identifier string of image being deployed. /// Offer identifier string of image being deployed. /// Plan identifier string of image being deployed. + /// Json string supplied to the MarketplaceAgreementsCreate 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). @@ -398,10 +553,10 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MarketplaceAgreementsGet(string subscriptionId, string publisherId, string offerId, string planId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateViaJsonString(string subscriptionId, string publisherId, string offerId, string planId, 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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { - var apiVersion = @"2021-01-01"; var offerType = @"virtualmachine"; + var apiVersion = @"2021-01-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -426,30 +581,34 @@ public partial class MarketplaceOrdering // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsCreate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get marketplace agreement. + /// Save marketplace terms. /// The subscription ID that identifies an Azure subscription. /// Publisher identifier string of image being deployed. /// Offer identifier string of image being deployed. /// Plan identifier string of image being deployed. - /// a delegate that is called 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 MarketplaceAgreementsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsGetAgreement(string subscriptionId, string publisherId, string offerId, string planId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsCreateViaJsonStringWithResult(string subscriptionId, string publisherId, string offerId, string planId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { + var offerType = @"virtualmachine"; var apiVersion = @"2021-01-01"; // Constant Parameters using( NoSynchronizationContext ) @@ -458,40 +617,335 @@ public partial class MarketplaceOrdering var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.MarketplaceOrdering/agreements/" + + "/providers/Microsoft.MarketplaceOrdering/offerTypes/" + + global::System.Uri.EscapeDataString(offerType) + + "/publishers/" + global::System.Uri.EscapeDataString(publisherId) + "/offers/" + global::System.Uri.EscapeDataString(offerId) + "/plans/" + global::System.Uri.EscapeDataString(planId) + + "/agreements/current" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MarketplaceAgreementsGetAgreement_Call(request,onOk,onDefault,eventListener,sender); + return await this.MarketplaceAgreementsCreateWithResult_Call (request, eventListener,sender); } } - /// Get marketplace agreement. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled + /// Save marketplace terms. + /// The subscription ID that identifies an Azure subscription. + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// Parameters supplied to the Create Marketplace Terms operation. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsCreateWithResult(string subscriptionId, string publisherId, string offerId, string planId, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms body, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeUpdate) + { + var offerType = @"virtualmachine"; + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.MarketplaceOrdering/offerTypes/" + + global::System.Uri.EscapeDataString(offerType) + + "/publishers/" + + global::System.Uri.EscapeDataString(publisherId) + + "/offers/" + + global::System.Uri.EscapeDataString(offerId) + + "/plans/" + + global::System.Uri.EscapeDataString(planId) + + "/agreements/current" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsCreateWithResult_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.MarketplaceOrdering.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 MarketplaceAgreementsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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 MarketplaceAgreementsGetAgreementViaIdentity(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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCreate_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The subscription ID that identifies an Azure subscription. + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// Parameters supplied to the Create Marketplace Terms operation. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsCreate_Validate(string subscriptionId, string publisherId, string offerId, string planId, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms body, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(publisherId),publisherId); + await eventListener.AssertNotNull(nameof(offerId),offerId); + await eventListener.AssertNotNull(nameof(planId),planId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get marketplace terms. + /// The subscription ID that identifies an Azure subscription. + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// a delegate that is called 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.MarketplaceOrdering.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 MarketplaceAgreementsGet(string subscriptionId, string publisherId, string offerId, string planId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var offerType = @"virtualmachine"; + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.MarketplaceOrdering/offerTypes/" + + global::System.Uri.EscapeDataString(offerType) + + "/publishers/" + + global::System.Uri.EscapeDataString(publisherId) + + "/offers/" + + global::System.Uri.EscapeDataString(offerId) + + "/plans/" + + global::System.Uri.EscapeDataString(planId) + + "/agreements/current" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MarketplaceAgreementsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get marketplace agreement. + /// The subscription ID that identifies an Azure subscription. + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// a delegate that is called 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.MarketplaceOrdering.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 MarketplaceAgreementsGetAgreement(string subscriptionId, string publisherId, string offerId, string planId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.MarketplaceOrdering/agreements/" + + global::System.Uri.EscapeDataString(publisherId) + + "/offers/" + + global::System.Uri.EscapeDataString(offerId) + + "/plans/" + + global::System.Uri.EscapeDataString(planId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MarketplaceAgreementsGetAgreement_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get marketplace agreement. + /// + /// a delegate that is called 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.MarketplaceOrdering.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 MarketplaceAgreementsGetAgreementViaIdentity(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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -533,11 +987,171 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsGetAgreement_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsGetAgreement_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get marketplace agreement. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsGetAgreementViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-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.MarketplaceOrdering/agreements/(?[^/]+)/offers/(?[^/]+)/plans/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var publisherId = _match.Groups["publisherId"].Value; + var offerId = _match.Groups["offerId"].Value; + var planId = _match.Groups["planId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.MarketplaceOrdering/agreements/" + + publisherId + + "/offers/" + + offerId + + "/plans/" + + planId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsGetAgreementWithResult_Call (request, eventListener,sender); + } + } + + /// Get marketplace agreement. + /// The subscription ID that identifies an Azure subscription. + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsGetAgreementWithResult(string subscriptionId, string publisherId, string offerId, string planId, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.MarketplaceOrdering/agreements/" + + global::System.Uri.EscapeDataString(publisherId) + + "/offers/" + + global::System.Uri.EscapeDataString(offerId) + + "/plans/" + + global::System.Uri.EscapeDataString(planId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsGetAgreementWithResult_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.MarketplaceOrdering.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 MarketplaceAgreementsGetAgreementWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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 @@ -547,7 +1161,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MarketplaceAgreementsGetAgreement_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsGetAgreement_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -558,6 +1172,7 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -565,13 +1180,13 @@ public partial class MarketplaceOrdering case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -619,7 +1234,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MarketplaceAgreementsGetViaIdentity(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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsGetViaIdentity(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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -665,11 +1280,177 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get marketplace terms. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-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.MarketplaceOrdering/offerTypes/(?[^/]+)/publishers/(?[^/]+)/offers/(?[^/]+)/plans/(?[^/]+)/agreements/current$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/{offerType}/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var offerType = _match.Groups["offerType"].Value; + var publisherId = _match.Groups["publisherId"].Value; + var offerId = _match.Groups["offerId"].Value; + var planId = _match.Groups["planId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.MarketplaceOrdering/offerTypes/" + + offerType + + "/publishers/" + + publisherId + + "/offers/" + + offerId + + "/plans/" + + planId + + "/agreements/current" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get marketplace terms. + /// The subscription ID that identifies an Azure subscription. + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsGetWithResult(string subscriptionId, string publisherId, string offerId, string planId, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var offerType = @"virtualmachine"; + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.MarketplaceOrdering/offerTypes/" + + global::System.Uri.EscapeDataString(offerType) + + "/publishers/" + + global::System.Uri.EscapeDataString(publisherId) + + "/offers/" + + global::System.Uri.EscapeDataString(offerId) + + "/plans/" + + global::System.Uri.EscapeDataString(planId) + + "/agreements/current" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsGetWithResult_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.MarketplaceOrdering.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 MarketplaceAgreementsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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 @@ -679,7 +1460,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MarketplaceAgreementsGet_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsGet_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -690,6 +1471,7 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -697,13 +1479,13 @@ public partial class MarketplaceOrdering case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -751,7 +1533,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MarketplaceAgreementsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsList(string subscriptionId, global::System.Func>, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -775,7 +1557,7 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsList_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -789,7 +1571,53 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MarketplaceAgreementsListViaIdentity(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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsListViaIdentity(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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-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.MarketplaceOrdering/agreements$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements'"); + } + + // 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.MarketplaceOrdering/agreements" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MarketplaceAgreementsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List marketplace agreements in the subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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> MarketplaceAgreementsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -800,34 +1628,132 @@ public partial class MarketplaceOrdering var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.MarketplaceOrdering/agreements$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements'"); + } + + // 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.MarketplaceOrdering/agreements" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsListWithResult_Call (request, eventListener,sender); + } + } + + /// List marketplace agreements in the subscription. + /// The subscription ID that identifies an Azure subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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> MarketplaceAgreementsListWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.MarketplaceOrdering/agreements" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsListWithResult_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.MarketplaceOrdering.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> MarketplaceAgreementsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IAgreementTerms) (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(__x) )) ))() : null); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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.MarketplaceOrdering/agreements" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MarketplaceAgreementsList_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 @@ -837,7 +1763,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MarketplaceAgreementsList_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsList_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -848,6 +1774,7 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -855,13 +1782,13 @@ public partial class MarketplaceOrdering case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IAgreementTerms) (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementTerms.FromJson(__x) )) ))() : null)); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => If( Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonArray.Parse(body.Result) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IAgreementTerms) (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(__x) )) ))() : null)); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -906,7 +1833,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MarketplaceAgreementsSign(string subscriptionId, string publisherId, string offerId, string planId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsSign(string subscriptionId, string publisherId, string offerId, string planId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -936,7 +1863,7 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsSign_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsSign_Call (request, onOk,onDefault,eventListener,sender); } } @@ -950,7 +1877,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MarketplaceAgreementsSignViaIdentity(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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MarketplaceAgreementsSignViaIdentity(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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -961,7 +1888,7 @@ public partial class MarketplaceOrdering var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.MarketplaceOrdering/agreements/(?[^/]+)/offers/(?[^/]+)/plans/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}'"); } // replace URI parameters with values from identity @@ -993,11 +1920,173 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MarketplaceAgreementsSign_Call(request,onOk,onDefault,eventListener,sender); + await this.MarketplaceAgreementsSign_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Sign marketplace terms. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsSignViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-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.MarketplaceOrdering/agreements/(?[^/]+)/offers/(?[^/]+)/plans/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var publisherId = _match.Groups["publisherId"].Value; + var offerId = _match.Groups["offerId"].Value; + var planId = _match.Groups["planId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.MarketplaceOrdering/agreements/" + + publisherId + + "/offers/" + + offerId + + "/plans/" + + planId + + "/sign" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsSignWithResult_Call (request, eventListener,sender); + } + } + + /// Sign marketplace terms. + /// The subscription ID that identifies an Azure subscription. + /// Publisher identifier string of image being deployed. + /// Offer identifier string of image being deployed. + /// Plan identifier string of image being deployed. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 MarketplaceAgreementsSignWithResult(string subscriptionId, string publisherId, string offerId, string planId, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.MarketplaceOrdering/agreements/" + + global::System.Uri.EscapeDataString(publisherId) + + "/offers/" + + global::System.Uri.EscapeDataString(offerId) + + "/plans/" + + global::System.Uri.EscapeDataString(planId) + + "/sign" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MarketplaceAgreementsSignWithResult_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.MarketplaceOrdering.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 MarketplaceAgreementsSignWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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 @@ -1007,7 +2096,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MarketplaceAgreementsSign_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MarketplaceAgreementsSign_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.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1018,6 +2107,7 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1025,13 +2115,13 @@ public partial class MarketplaceOrdering case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementTerms.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1078,7 +2168,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -1100,7 +2190,7 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -1114,7 +2204,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -1145,11 +2235,147 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Lists all of the available Microsoft.MarketplaceOrdering REST API operations. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-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.MarketplaceOrdering/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.MarketplaceOrdering/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.MarketplaceOrdering/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Lists all of the available Microsoft.MarketplaceOrdering REST API operations. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.MarketplaceOrdering/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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 @@ -1159,7 +2385,7 @@ public partial class MarketplaceOrdering /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1170,6 +2396,7 @@ public partial class MarketplaceOrdering await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1177,13 +2404,13 @@ public partial class MarketplaceOrdering case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.PowerShell.cs similarity index 62% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.PowerShell.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.PowerShell.cs index 99409a36efdf..e1095acc4edc 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.PowerShell.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AgreementProperties 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,45 +78,45 @@ internal AgreementProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); } if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); } if (content.Contains("LicenseTextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); } if (content.Contains("PrivacyPolicyLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); } if (content.Contains("MarketplaceTermsLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).MarketplaceTermsLink = (string) content.GetValueForProperty("MarketplaceTermsLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).MarketplaceTermsLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).MarketplaceTermsLink = (string) content.GetValueForProperty("MarketplaceTermsLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).MarketplaceTermsLink, global::System.Convert.ToString); } if (content.Contains("RetrieveDatetime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Signature")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); } if (content.Contains("Accepted")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Accepted, (__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. @@ -131,67 +131,65 @@ internal AgreementProperties(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Publisher")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Publisher, global::System.Convert.ToString); } if (content.Contains("Product")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Product, global::System.Convert.ToString); } if (content.Contains("Plan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Plan, global::System.Convert.ToString); } if (content.Contains("LicenseTextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).LicenseTextLink, global::System.Convert.ToString); } if (content.Contains("PrivacyPolicyLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); } if (content.Contains("MarketplaceTermsLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).MarketplaceTermsLink = (string) content.GetValueForProperty("MarketplaceTermsLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).MarketplaceTermsLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).MarketplaceTermsLink = (string) content.GetValueForProperty("MarketplaceTermsLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).MarketplaceTermsLink, global::System.Convert.ToString); } if (content.Contains("RetrieveDatetime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Signature")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Signature, global::System.Convert.ToString); } if (content.Contains("Accepted")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } 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.MarketplaceOrdering.Models.Api202101.IAgreementProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AgreementProperties(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.MarketplaceOrdering.Models.Api202101.IAgreementProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AgreementProperties(content); } @@ -201,7 +199,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.TypeConverter.cs similarity index 97% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.TypeConverter.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.TypeConverter.cs index 73cba8a9e4ba..2176a7614af0 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.TypeConverter.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IAgreementProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.cs similarity index 93% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.cs index 43a4f5315225..19052f47a580 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; /// Agreement Terms definition public partial class AgreementProperties : - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal { /// Backing field for property. @@ -92,6 +92,9 @@ public partial interface IAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If any version of the terms have been accepted, otherwise false.", SerializedName = @"accepted", PossibleTypes = new [] { typeof(bool) })] @@ -100,6 +103,9 @@ public partial interface IAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to HTML with Microsoft and Publisher terms.", SerializedName = @"licenseTextLink", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +114,9 @@ public partial interface IAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to HTML with Azure Marketplace terms.", SerializedName = @"marketplaceTermsLink", PossibleTypes = new [] { typeof(string) })] @@ -116,6 +125,9 @@ public partial interface IAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Plan identifier string of image being deployed.", SerializedName = @"plan", PossibleTypes = new [] { typeof(string) })] @@ -124,6 +136,9 @@ public partial interface IAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the privacy policy of the publisher.", SerializedName = @"privacyPolicyLink", PossibleTypes = new [] { typeof(string) })] @@ -132,6 +147,9 @@ public partial interface IAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer identifier string of image being deployed.", SerializedName = @"product", PossibleTypes = new [] { typeof(string) })] @@ -140,6 +158,9 @@ public partial interface IAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher identifier string of image being deployed.", SerializedName = @"publisher", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +171,9 @@ public partial interface IAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date and time in UTC of when the terms were accepted. This is empty if Accepted is false.", SerializedName = @"retrieveDatetime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -158,6 +182,9 @@ public partial interface IAgreementProperties : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Terms signature.", SerializedName = @"signature", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.json.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.json.cs similarity index 93% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.json.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.json.cs index 8d79e2c0f09a..ac8622b0131b 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementProperties.json.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementProperties.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -65,26 +65,26 @@ internal AgreementProperties(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrder { return; } - {_publisher = If( json?.PropertyT("publisher"), out var __jsonPublisher) ? (string)__jsonPublisher : (string)Publisher;} - {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)Product;} - {_plan = If( json?.PropertyT("plan"), out var __jsonPlan) ? (string)__jsonPlan : (string)Plan;} - {_licenseTextLink = If( json?.PropertyT("licenseTextLink"), out var __jsonLicenseTextLink) ? (string)__jsonLicenseTextLink : (string)LicenseTextLink;} - {_privacyPolicyLink = If( json?.PropertyT("privacyPolicyLink"), out var __jsonPrivacyPolicyLink) ? (string)__jsonPrivacyPolicyLink : (string)PrivacyPolicyLink;} - {_marketplaceTermsLink = If( json?.PropertyT("marketplaceTermsLink"), out var __jsonMarketplaceTermsLink) ? (string)__jsonMarketplaceTermsLink : (string)MarketplaceTermsLink;} - {_retrieveDatetime = If( json?.PropertyT("retrieveDatetime"), out var __jsonRetrieveDatetime) ? global::System.DateTime.TryParse((string)__jsonRetrieveDatetime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRetrieveDatetimeValue) ? __jsonRetrieveDatetimeValue : RetrieveDatetime : RetrieveDatetime;} - {_signature = If( json?.PropertyT("signature"), out var __jsonSignature) ? (string)__jsonSignature : (string)Signature;} - {_accepted = If( json?.PropertyT("accepted"), out var __jsonAccepted) ? (bool?)__jsonAccepted : Accepted;} + {_publisher = If( json?.PropertyT("publisher"), out var __jsonPublisher) ? (string)__jsonPublisher : (string)_publisher;} + {_product = If( json?.PropertyT("product"), out var __jsonProduct) ? (string)__jsonProduct : (string)_product;} + {_plan = If( json?.PropertyT("plan"), out var __jsonPlan) ? (string)__jsonPlan : (string)_plan;} + {_licenseTextLink = If( json?.PropertyT("licenseTextLink"), out var __jsonLicenseTextLink) ? (string)__jsonLicenseTextLink : (string)_licenseTextLink;} + {_privacyPolicyLink = If( json?.PropertyT("privacyPolicyLink"), out var __jsonPrivacyPolicyLink) ? (string)__jsonPrivacyPolicyLink : (string)_privacyPolicyLink;} + {_marketplaceTermsLink = If( json?.PropertyT("marketplaceTermsLink"), out var __jsonMarketplaceTermsLink) ? (string)__jsonMarketplaceTermsLink : (string)_marketplaceTermsLink;} + {_retrieveDatetime = If( json?.PropertyT("retrieveDatetime"), out var __jsonRetrieveDatetime) ? global::System.DateTime.TryParse((string)__jsonRetrieveDatetime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRetrieveDatetimeValue) ? __jsonRetrieveDatetimeValue : _retrieveDatetime : _retrieveDatetime;} + {_signature = If( json?.PropertyT("signature"), out var __jsonSignature) ? (string)__jsonSignature : (string)_signature;} + {_accepted = If( json?.PropertyT("accepted"), out var __jsonAccepted) ? (bool?)__jsonAccepted : _accepted;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject json ? new AgreementProperties(json) : null; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.PowerShell.cs new file mode 100644 index 000000000000..b64026a146b9 --- /dev/null +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.PowerShell.cs @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + + /// Terms properties for provided Publisher/Offer/Plan tuple + [System.ComponentModel.TypeConverter(typeof(AgreementTermsTypeConverter))] + public partial class AgreementTerms + { + + /// + /// 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 AgreementTerms(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.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)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("Publisher")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Publisher, global::System.Convert.ToString); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("Plan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Plan, global::System.Convert.ToString); + } + if (content.Contains("LicenseTextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).LicenseTextLink, global::System.Convert.ToString); + } + if (content.Contains("PrivacyPolicyLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + } + if (content.Contains("MarketplaceTermsLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).MarketplaceTermsLink = (string) content.GetValueForProperty("MarketplaceTermsLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).MarketplaceTermsLink, global::System.Convert.ToString); + } + if (content.Contains("RetrieveDatetime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Signature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Signature, global::System.Convert.ToString); + } + if (content.Contains("Accepted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AgreementTerms(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.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)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("Publisher")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Publisher, global::System.Convert.ToString); + } + if (content.Contains("Product")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Product, global::System.Convert.ToString); + } + if (content.Contains("Plan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Plan, global::System.Convert.ToString); + } + if (content.Contains("LicenseTextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).LicenseTextLink, global::System.Convert.ToString); + } + if (content.Contains("PrivacyPolicyLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); + } + if (content.Contains("MarketplaceTermsLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).MarketplaceTermsLink = (string) content.GetValueForProperty("MarketplaceTermsLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).MarketplaceTermsLink, global::System.Convert.ToString); + } + if (content.Contains("RetrieveDatetime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Signature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Signature, global::System.Convert.ToString); + } + if (content.Contains("Accepted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgreementTerms(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.MarketplaceOrdering.Models.IAgreementTerms DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgreementTerms(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.MarketplaceOrdering.Models.IAgreementTerms FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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(); + } + } + /// Terms properties for provided Publisher/Offer/Plan tuple + [System.ComponentModel.TypeConverter(typeof(AgreementTermsTypeConverter))] + public partial interface IAgreementTerms + + { + + } +} \ No newline at end of file diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.TypeConverter.cs similarity index 97% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.TypeConverter.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.TypeConverter.cs index fae147e85f5e..5c1558bae780 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.TypeConverter.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IAgreementTerms ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.cs similarity index 63% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.cs index 4b64a9bacb97..75fe1cf8298f 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.cs @@ -3,144 +3,167 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; /// Terms properties for provided Publisher/Offer/Plan tuple public partial class AgreementTerms : - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Resource(); /// If any version of the terms have been accepted, otherwise false. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.FormatTable(Index = 3)] - public bool? Accepted { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).Accepted; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).Accepted = value ?? default(bool); } + public bool? Accepted { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).Accepted; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).Accepted = value ?? default(bool); } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)__resource).Id; } /// Link to HTML with Microsoft and Publisher terms. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public string LicenseTextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).LicenseTextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).LicenseTextLink = value ?? null; } + public string LicenseTextLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).LicenseTextLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).LicenseTextLink = value ?? null; } /// Link to HTML with Azure Marketplace terms. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public string MarketplaceTermsLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).MarketplaceTermsLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).MarketplaceTermsLink = value ?? null; } + public string MarketplaceTermsLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).MarketplaceTermsLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).MarketplaceTermsLink = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementProperties()); set { {_property = value;} } } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).CreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).CreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).CreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).LastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).LastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTermsInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).LastModifiedByType = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.FormatTable(Index = 0)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)__resource).Name; } /// Plan identifier string of image being deployed. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public string Plan { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).Plan; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).Plan = value ?? null; } + public string Plan { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).Plan; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).Plan = value ?? null; } /// Link to the privacy policy of the publisher. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.FormatTable(Index = 5)] - public string PrivacyPolicyLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).PrivacyPolicyLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).PrivacyPolicyLink = value ?? null; } + public string PrivacyPolicyLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).PrivacyPolicyLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).PrivacyPolicyLink = value ?? null; } /// Offer identifier string of image being deployed. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.FormatTable(Index = 1)] - public string Product { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).Product = value ?? null; } + public string Product { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).Product; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).Product = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties _property; /// Represents the properties of the resource. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementProperties()); set => this._property = value; } /// Publisher identifier string of image being deployed. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.FormatTable(Index = 2)] - public string Publisher { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).Publisher; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).Publisher = value ?? null; } + public string Publisher { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).Publisher; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).Publisher = value ?? null; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// /// Date and time in UTC of when the terms were accepted. This is empty if Accepted is false. /// [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public global::System.DateTime? RetrieveDatetime { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).RetrieveDatetime; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).RetrieveDatetime = value ?? default(global::System.DateTime); } + public global::System.DateTime? RetrieveDatetime { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).RetrieveDatetime; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).RetrieveDatetime = value ?? default(global::System.DateTime); } /// Terms signature. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.FormatTable(Index = 4)] - public string Signature { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).Signature; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementPropertiesInternal)Property).Signature = value ?? null; } + public string Signature { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).Signature; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementPropertiesInternal)Property).Signature = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData _systemData; /// The system meta data relating to this resource. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public AgreementTerms() @@ -163,12 +186,15 @@ public AgreementTerms() /// Terms properties for provided Publisher/Offer/Plan tuple public partial interface IAgreementTerms : Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResource + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResource { /// If any version of the terms have been accepted, otherwise false. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If any version of the terms have been accepted, otherwise false.", SerializedName = @"accepted", PossibleTypes = new [] { typeof(bool) })] @@ -177,6 +203,9 @@ public partial interface IAgreementTerms : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to HTML with Microsoft and Publisher terms.", SerializedName = @"licenseTextLink", PossibleTypes = new [] { typeof(string) })] @@ -185,6 +214,9 @@ public partial interface IAgreementTerms : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to HTML with Azure Marketplace terms.", SerializedName = @"marketplaceTermsLink", PossibleTypes = new [] { typeof(string) })] @@ -193,6 +225,9 @@ public partial interface IAgreementTerms : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Plan identifier string of image being deployed.", SerializedName = @"plan", PossibleTypes = new [] { typeof(string) })] @@ -201,6 +236,9 @@ public partial interface IAgreementTerms : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Link to the privacy policy of the publisher.", SerializedName = @"privacyPolicyLink", PossibleTypes = new [] { typeof(string) })] @@ -209,6 +247,9 @@ public partial interface IAgreementTerms : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer identifier string of image being deployed.", SerializedName = @"product", PossibleTypes = new [] { typeof(string) })] @@ -217,6 +258,9 @@ public partial interface IAgreementTerms : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher identifier string of image being deployed.", SerializedName = @"publisher", PossibleTypes = new [] { typeof(string) })] @@ -227,6 +271,9 @@ public partial interface IAgreementTerms : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Date and time in UTC of when the terms were accepted. This is empty if Accepted is false.", SerializedName = @"retrieveDatetime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -235,6 +282,9 @@ public partial interface IAgreementTerms : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Terms signature.", SerializedName = @"signature", PossibleTypes = new [] { typeof(string) })] @@ -242,56 +292,76 @@ public partial interface IAgreementTerms : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } } /// Terms properties for provided Publisher/Offer/Plan tuple internal partial interface IAgreementTermsInternal : - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal { /// If any version of the terms have been accepted, otherwise false. bool? Accepted { get; set; } @@ -306,7 +376,7 @@ internal partial interface IAgreementTermsInternal : /// Offer identifier string of image being deployed. string Product { get; set; } /// Represents the properties of the resource. - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementProperties Property { get; set; } /// Publisher identifier string of image being deployed. string Publisher { get; set; } /// @@ -316,19 +386,21 @@ internal partial interface IAgreementTermsInternal : /// Terms signature. string Signature { get; set; } /// The system meta data relating to this resource. - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.json.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.json.cs similarity index 93% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.json.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.json.cs index 7f240dfc2205..4985d08b5089 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.json.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/AgreementTerms.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -65,20 +65,20 @@ internal AgreementTerms(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.R { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementProperties.FromJson(__jsonProperties) : Property;} - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.AgreementProperties.FromJson(__jsonProperties) : _property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject json ? new AgreementTerms(json) : null; } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonN } __resource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.PowerShell.cs deleted file mode 100644 index d90c72eb46bc..000000000000 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/AgreementTerms.PowerShell.cs +++ /dev/null @@ -1,316 +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.MarketplaceOrdering.Models.Api202101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; - - /// Terms properties for provided Publisher/Offer/Plan tuple - [System.ComponentModel.TypeConverter(typeof(AgreementTermsTypeConverter))] - public partial class AgreementTerms - { - - /// - /// 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 AgreementTerms(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.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)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("Publisher")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Publisher, global::System.Convert.ToString); - } - if (content.Contains("Product")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Product, global::System.Convert.ToString); - } - if (content.Contains("Plan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Plan, global::System.Convert.ToString); - } - if (content.Contains("LicenseTextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).LicenseTextLink, global::System.Convert.ToString); - } - if (content.Contains("PrivacyPolicyLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); - } - if (content.Contains("MarketplaceTermsLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).MarketplaceTermsLink = (string) content.GetValueForProperty("MarketplaceTermsLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).MarketplaceTermsLink, global::System.Convert.ToString); - } - if (content.Contains("RetrieveDatetime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Signature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Signature, global::System.Convert.ToString); - } - if (content.Contains("Accepted")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)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 . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AgreementTerms(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.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.AgreementPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)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("Publisher")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Publisher = (string) content.GetValueForProperty("Publisher",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Publisher, global::System.Convert.ToString); - } - if (content.Contains("Product")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Product = (string) content.GetValueForProperty("Product",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Product, global::System.Convert.ToString); - } - if (content.Contains("Plan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Plan = (string) content.GetValueForProperty("Plan",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Plan, global::System.Convert.ToString); - } - if (content.Contains("LicenseTextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).LicenseTextLink = (string) content.GetValueForProperty("LicenseTextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).LicenseTextLink, global::System.Convert.ToString); - } - if (content.Contains("PrivacyPolicyLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).PrivacyPolicyLink = (string) content.GetValueForProperty("PrivacyPolicyLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).PrivacyPolicyLink, global::System.Convert.ToString); - } - if (content.Contains("MarketplaceTermsLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).MarketplaceTermsLink = (string) content.GetValueForProperty("MarketplaceTermsLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).MarketplaceTermsLink, global::System.Convert.ToString); - } - if (content.Contains("RetrieveDatetime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).RetrieveDatetime = (global::System.DateTime?) content.GetValueForProperty("RetrieveDatetime",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).RetrieveDatetime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Signature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Signature = (string) content.GetValueForProperty("Signature",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Signature, global::System.Convert.ToString); - } - if (content.Contains("Accepted")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Accepted = (bool?) content.GetValueForProperty("Accepted",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).Accepted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTermsInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AgreementTerms(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.MarketplaceOrdering.Models.Api202101.IAgreementTerms DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AgreementTerms(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.MarketplaceOrdering.Models.Api202101.IAgreementTerms FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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(); - } - } - /// Terms properties for provided Publisher/Offer/Plan tuple - [System.ComponentModel.TypeConverter(typeof(AgreementTermsTypeConverter))] - public partial interface IAgreementTerms - - { - - } -} \ No newline at end of file diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 76% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.PowerShell.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 4eb92306cd91..406e7f0fec77 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.PowerShell.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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,21 +107,21 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponseErrorTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponseErrorTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,15 +136,15 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponseErrorTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponseErrorTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -154,7 +154,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.MarketplaceOrdering.Models.Api202101.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.TypeConverter.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 7a24107ff1d5..a9285f06016b 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.TypeConverter.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponse.cs similarity index 72% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponse.cs index eb121a09ffd1..430c0f9bb20b 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -12,33 +12,33 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20210 /// is provided in the error message. /// public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal { /// Error code. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)Error).Code; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)Error).Code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseError _error; + private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError _error; /// The details of the error. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponseError()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponseError()); set => this._error = value; } /// Error message indicating why the operation failed. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)Error).Message; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)Error).Message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)Error).Code = value; } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)Error).Code = value; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseError Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponseError()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponseError()); set { {_error = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)Error).Message = value; } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)Error).Message = value; } /// Creates an new instance. public ErrorResponse() @@ -55,6 +55,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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) })] @@ -77,7 +83,7 @@ internal partial interface IErrorResponseInternal /// Error code. string Code { get; set; } /// The details of the error. - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseError Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError Error { get; set; } /// Error message indicating why the operation failed. string Message { get; set; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.json.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.json.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponse.json.cs index eddea62dfeaa..d12715f18f49 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponse.json.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -68,18 +68,18 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Ru { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.ErrorResponseError.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ErrorResponseError.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.PowerShell.cs similarity index 80% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.PowerShell.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.PowerShell.cs index 1653d97e0fce..8b492deef196 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.PowerShell.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class ErrorResponseError 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.MarketplaceOrdering.Models.Api202101.IErrorResponseError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponseError(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.MarketplaceOrdering.Models.Api202101.IErrorResponseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponseError(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,17 +104,17 @@ internal ErrorResponseError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)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. @@ -131,11 +129,11 @@ internal ErrorResponseError(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,7 +143,7 @@ internal ErrorResponseError(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.MarketplaceOrdering.Models.Api202101.IErrorResponseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.TypeConverter.cs similarity index 97% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.TypeConverter.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.TypeConverter.cs index 922d6811d6c8..0ff4b2323995 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.TypeConverter.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IErrorResponseError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.cs similarity index 88% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.cs index 5e55b6b3cab0..51c7dd96647c 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; /// The details of the error. public partial class ErrorResponseError : - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseError, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal { /// Backing field for property. @@ -28,10 +28,10 @@ public partial class ErrorResponseError : public string Message { get => this._message; } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseErrorInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseErrorInternal.Message { get => this._message; set { {_message = value;} } } /// Creates an new instance. public ErrorResponseError() @@ -47,6 +47,9 @@ public partial interface IErrorResponseError : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -55,6 +58,9 @@ public partial interface IErrorResponseError : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Error message indicating why the operation failed.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.json.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.json.cs similarity index 95% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.json.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.json.cs index 73e66e664c6d..b077e66c3870 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/ErrorResponseError.json.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/ErrorResponseError.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorResponseError(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrderi { 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.MarketplaceOrdering.Models.Api202101.IErrorResponseError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject json ? new ErrorResponseError(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.PowerShell.cs index facf65328258..b0c173208975 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.PowerShell.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.PowerShell.cs @@ -116,7 +116,7 @@ internal MarketplaceOrderingIdentity(global::System.Collections.IDictionary cont } if (content.Contains("OfferType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentityInternal)this).OfferType = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType?) content.GetValueForProperty("OfferType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentityInternal)this).OfferType, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentityInternal)this).OfferType = (string) content.GetValueForProperty("OfferType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentityInternal)this).OfferType, global::System.Convert.ToString); } if (content.Contains("PublisherId")) { @@ -157,7 +157,7 @@ internal MarketplaceOrderingIdentity(global::System.Management.Automation.PSObje } if (content.Contains("OfferType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentityInternal)this).OfferType = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType?) content.GetValueForProperty("OfferType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentityInternal)this).OfferType, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentityInternal)this).OfferType = (string) content.GetValueForProperty("OfferType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentityInternal)this).OfferType, global::System.Convert.ToString); } if (content.Contains("PublisherId")) { diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.cs index 4e70f532cf87..f4d183650c2d 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.cs @@ -27,11 +27,11 @@ public partial class MarketplaceOrderingIdentity : public string OfferId { get => this._offerId; set => this._offerId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType? _offerType; + private string _offerType; /// Offer Type, currently only virtualmachine type is supported. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType? OfferType { get => this._offerType; set => this._offerType = value; } + public string OfferType { get => this._offerType; set => this._offerType = value; } /// Backing field for property. private string _planId; @@ -67,6 +67,9 @@ public partial interface IMarketplaceOrderingIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface IMarketplaceOrderingIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer identifier string of image being deployed.", SerializedName = @"offerId", PossibleTypes = new [] { typeof(string) })] @@ -83,14 +89,21 @@ public partial interface IMarketplaceOrderingIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Offer Type, currently only virtualmachine type is supported.", SerializedName = @"offerType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType) })] - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType? OfferType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PSArgumentCompleterAttribute("virtualmachine")] + string OfferType { get; set; } /// Plan identifier string of image being deployed. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Plan identifier string of image being deployed.", SerializedName = @"planId", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +112,9 @@ public partial interface IMarketplaceOrderingIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Publisher identifier string of image being deployed.", SerializedName = @"publisherId", PossibleTypes = new [] { typeof(string) })] @@ -107,6 +123,9 @@ public partial interface IMarketplaceOrderingIdentity : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The subscription ID that identifies an Azure subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -121,7 +140,8 @@ internal partial interface IMarketplaceOrderingIdentityInternal /// Offer identifier string of image being deployed. string OfferId { get; set; } /// Offer Type, currently only virtualmachine type is supported. - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType? OfferType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PSArgumentCompleterAttribute("virtualmachine")] + string OfferType { get; set; } /// Plan identifier string of image being deployed. string PlanId { get; set; } /// Publisher identifier string of image being deployed. diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.json.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.json.cs index 02014d13eb40..cc8f5e6783c7 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.json.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/MarketplaceOrderingIdentity.json.cs @@ -76,12 +76,12 @@ internal MarketplaceOrderingIdentity(Microsoft.Azure.PowerShell.Cmdlets.Marketpl { return; } - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_offerType = If( json?.PropertyT("offerType"), out var __jsonOfferType) ? (string)__jsonOfferType : (string)OfferType;} - {_publisherId = If( json?.PropertyT("publisherId"), out var __jsonPublisherId) ? (string)__jsonPublisherId : (string)PublisherId;} - {_offerId = If( json?.PropertyT("offerId"), out var __jsonOfferId) ? (string)__jsonOfferId : (string)OfferId;} - {_planId = If( json?.PropertyT("planId"), out var __jsonPlanId) ? (string)__jsonPlanId : (string)PlanId;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_offerType = If( json?.PropertyT("offerType"), out var __jsonOfferType) ? (string)__jsonOfferType : (string)_offerType;} + {_publisherId = If( json?.PropertyT("publisherId"), out var __jsonPublisherId) ? (string)__jsonPublisherId : (string)_publisherId;} + {_offerId = If( json?.PropertyT("offerId"), out var __jsonOfferId) ? (string)__jsonOfferId : (string)_offerId;} + {_planId = If( json?.PropertyT("planId"), out var __jsonPlanId) ? (string)__jsonPlanId : (string)_planId;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.PowerShell.cs similarity index 68% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.PowerShell.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.PowerShell.cs index ea8f2913a1f7..8ab2c7f3a6b9 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.PowerShell.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Operation 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.MarketplaceOrdering.Models.Api202101.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Operation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Operation(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 Operation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -152,27 +152,27 @@ internal Operation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.TypeConverter.cs similarity index 97% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.TypeConverter.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.TypeConverter.cs index 2c1ada8f2007..1e181136fb26 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.TypeConverter.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IOperation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.cs similarity index 77% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.cs index d2247d8bc2b9..90510f743ba1 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.cs @@ -3,41 +3,41 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; /// Microsoft.MarketplaceOrdering REST API operation public partial class Operation : - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay _display; /// The object that represents the operation. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationDisplay()); set => this._display = value; } /// Operation description. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)Display).Description = value ?? null; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)Display).Description = value ?? null; } /// Operation type: Get Agreement, Sign Agreement, Cancel Agreement etc. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)Display).Operation = value ?? null; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } /// Service provider: Microsoft.MarketplaceOrdering [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)Display).Provider = value ?? null; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)Display).Provider = value ?? null; } /// Resource on which the operation is performed: Agreement, virtualmachine, etc. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)Display).Resource = value ?? null; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationDisplay()); set { {_display = value;} } } /// Backing field for property. private string _name; @@ -60,6 +60,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation description.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -68,6 +71,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation type: Get Agreement, Sign Agreement, Cancel Agreement etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +82,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider: Microsoft.MarketplaceOrdering", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -84,6 +93,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource on which the operation is performed: Agreement, virtualmachine, etc.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +104,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation name: {provider}/{resource}/{operation}", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -103,7 +118,7 @@ internal partial interface IOperationInternal { /// The object that represents the operation. - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay Display { get; set; } /// Operation description. string DisplayDescription { get; set; } /// Operation type: Get Agreement, Sign Agreement, Cancel Agreement etc. diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.json.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.json.cs similarity index 94% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.json.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.json.cs index 0745ef3dfc05..4b7aabda82ac 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Operation.json.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Operation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Operation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject json ? new Operation(json) : null; } @@ -77,8 +77,8 @@ internal Operation(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtim { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 74% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.PowerShell.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index 46c0ab396087..a35873b29695 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.PowerShell.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.TypeConverter.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index d532850b8abb..7f07a7f95548 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.TypeConverter.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationDisplay.cs similarity index 93% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationDisplay.cs index 1fe8ee9caf94..21c1a5d096bd 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; /// The object that represents the operation. public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplayInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation description.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Operation type: Get Agreement, Sign Agreement, Cancel Agreement etc.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Service provider: Microsoft.MarketplaceOrdering", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource on which the operation is performed: Agreement, virtualmachine, etc.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.json.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 96% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.json.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationDisplay.json.cs index 4846e6f8a9e3..cad39cae156d 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationDisplay.json.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering { 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.PowerShell.cs similarity index 76% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.PowerShell.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.PowerShell.cs index 386907db5aae..59ee2cd7dc94 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.PowerShell.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; @@ -66,29 +66,27 @@ public partial class OperationListResult 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.MarketplaceOrdering.Models.Api202101.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationListResult(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationListResult(content); } @@ -98,10 +96,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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,17 +114,17 @@ internal OperationListResult(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -141,11 +139,11 @@ internal OperationListResult(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs similarity index 97% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.TypeConverter.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs index 815b99385a36..d6d04d8041b1 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.TypeConverter.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IOperationListResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.cs similarity index 80% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.cs index df9110fe9824..a1408557ec46 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -12,12 +12,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20210 /// next set of results. /// public partial class OperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResult, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResultInternal + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResultInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Backing field for property. private string _nextLink; @@ -27,13 +27,13 @@ public partial class OperationListResult : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation[] _value; + private System.Collections.Generic.List _value; /// /// List of Microsoft.MarketplaceOrdering operations supported by the Microsoft.MarketplaceOrdering resource provider. /// [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation[] 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 OperationListResult() @@ -50,6 +50,9 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next set of operation list results if there are any.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -60,10 +63,13 @@ public partial interface IOperationListResult : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of Microsoft.MarketplaceOrdering operations supported by the Microsoft.MarketplaceOrdering resource provider.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation) })] - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation) })] + System.Collections.Generic.List Value { get; set; } } /// Result of the request to list MarketplaceOrdering operations. It contains a list of operations and a URL link to get the @@ -76,7 +82,7 @@ internal partial interface IOperationListResultInternal /// /// List of Microsoft.MarketplaceOrdering operations supported by the Microsoft.MarketplaceOrdering resource provider. /// - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.json.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.json.cs similarity index 91% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.json.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.json.cs index 7282d1058e79..ad337461b780 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/OperationListResult.json.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/OperationListResult.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class OperationListResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; } @@ -80,8 +80,8 @@ internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrder { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.Operation.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Operation.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonN } container.Add("value",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 78% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.PowerShell.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Resource.PowerShell.cs index 331a80d863fd..cf4b34651d74 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.PowerShell.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; @@ -63,27 +63,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.MarketplaceOrdering.Models.Api202101.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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. @@ -140,15 +140,15 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 97% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.TypeConverter.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Resource.TypeConverter.cs index 19b17c8ac4af..e1a87da5be08 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.TypeConverter.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Resource.cs similarity index 88% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Resource.cs index 04c53b1b6a8a..e6aa34eb232c 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Resource.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; /// ARM resource. public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResource, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal { /// Backing field for property. @@ -21,13 +21,13 @@ public partial class Resource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -57,6 +57,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +79,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.json.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Resource.json.cs similarity index 94% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.json.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Resource.json.cs index df8e841f43ab..f24787274971 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api202101/Resource.json.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -77,9 +77,9 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_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); } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonN { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 65% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/SystemData.PowerShell.cs index 503e8843410d..8906a9fe8243 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api2 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.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.MarketplaceOrdering.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.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.MarketplaceOrdering.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.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.MarketplaceOrdering.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.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.MarketplaceOrdering.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 97% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 835d4c3c5a7d..4f0c46439073 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/SystemData.cs similarity index 80% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/SystemData.cs index a82c35898f86..c6e998340b32 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Origin(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.json.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/SystemData.json.cs similarity index 95% rename from generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.json.cs rename to generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/SystemData.json.cs index 6a4ef65f7807..b4bbd9340bb3 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Models/Api20/SystemData.json.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api20.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +77,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runti { 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index 648b9f9b5761..000000000000 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index c1806e1b360b..000000000000 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/CreatedByType.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index 282c6fa5df41..000000000000 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.Completer.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.Completer.cs deleted file mode 100644 index a55fca78a9ef..000000000000 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.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.MarketplaceOrdering.Support -{ - - /// Argument completer implementation for OfferType. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferTypeTypeConverter))] - public partial struct OfferType : - 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) || "virtualmachine".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'virtualmachine'", "virtualmachine", global::System.Management.Automation.CompletionResultType.ParameterValue, "virtualmachine"); - } - } - } -} \ No newline at end of file diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.TypeConverter.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.TypeConverter.cs deleted file mode 100644 index ee698ff5c685..000000000000 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.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.MarketplaceOrdering.Support -{ - - /// TypeConverter implementation for OfferType. - public partial class OfferTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => OfferType.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.cs deleted file mode 100644 index b9170e62bcf1..000000000000 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/api/Support/OfferType.cs +++ /dev/null @@ -1,95 +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.MarketplaceOrdering.Support -{ - - public partial struct OfferType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType Virtualmachine = @"virtualmachine"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to OfferType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new OfferType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type OfferType - /// 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.MarketplaceOrdering.Support.OfferType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type OfferType (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 OfferType && Equals((OfferType)obj); - } - - /// Returns hashCode for enum OfferType - /// 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 OfferType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for OfferType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to OfferType - /// the value to convert to an instance of . - - public static implicit operator OfferType(string value) - { - return new OfferType(value); - } - - /// Implicit operator to convert OfferType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType e) - { - return e._value; - } - - /// Overriding != operator for enum OfferType - /// 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.MarketplaceOrdering.Support.OfferType e1, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum OfferType - /// 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.MarketplaceOrdering.Support.OfferType e1, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support.OfferType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceOperation_List.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceOperation_List.cs index 7caa442ba7e3..ce966fc0d295 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceOperation_List.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; using System; /// Lists all of the available Microsoft.MarketplaceOrdering REST API operations. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMarketplaceOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Lists all of the available Microsoft.MarketplaceOrdering REST API operations.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/providers/Microsoft.MarketplaceOrdering/operations", ApiVersion = "2021-01-01")] public partial class GetAzMarketplaceOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 GetAzMarketplaceOperation_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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.ClientAPI; @@ -59,6 +77,9 @@ public partial class GetAzMarketplaceOperation_List : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 GetAzMarketplaceOperation_List : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 GetAzMarketplaceOperation_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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -148,6 +169,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 GetAzMarketplaceOperation_List() { @@ -220,8 +246,33 @@ public GetAzMarketplaceOperation_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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -292,7 +343,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -352,7 +403,7 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,15 +438,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperationListResult + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceTerms_Get.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceTerms_Get.cs index b9f974d7702b..3b66356c16be 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceTerms_Get.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceTerms_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; using System; /// Get marketplace terms. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMarketplaceTerms_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Get marketplace terms.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/{offerType}/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current", ApiVersion = "2021-01-01")] public partial class GetAzMarketplaceTerms_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzMarketplaceTerms_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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzMarketplaceTerms_Get : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 GetAzMarketplaceTerms_Get : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _product; @@ -153,7 +174,8 @@ public partial class GetAzMarketplaceTerms_Get : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -162,24 +184,24 @@ public partial class GetAzMarketplaceTerms_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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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) @@ -202,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.MarketplaceOrdering.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -223,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzMarketplaceTerms_Get() { @@ -274,8 +301,33 @@ public GetAzMarketplaceTerms_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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -328,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -349,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Publisher=Publisher,Product=Product,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Publisher=Publisher,Product=Product,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 ) { @@ -409,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.MarketplaceOrdering.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Publisher=Publisher, Product=Product, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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, Publisher=Publisher, Product=Product, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -427,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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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 ) { @@ -444,8 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceTerms_Get1.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceTerms_Get1.cs index 6f9eb8fd8746..5ea213f57982 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceTerms_Get1.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/GetAzMarketplaceTerms_Get1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; using System; /// Get marketplace agreement. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzMarketplaceTerms_Get1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Get marketplace agreement.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}", ApiVersion = "2021-01-01")] public partial class GetAzMarketplaceTerms_Get1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class GetAzMarketplaceTerms_Get1 : 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; + /// 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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class GetAzMarketplaceTerms_Get1 : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 GetAzMarketplaceTerms_Get1 : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _product; @@ -153,7 +174,8 @@ public partial class GetAzMarketplaceTerms_Get1 : global::System.Management.Auto [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -162,24 +184,24 @@ public partial class GetAzMarketplaceTerms_Get1 : 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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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) @@ -202,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.MarketplaceOrdering.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -223,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzMarketplaceTerms_Get1() { @@ -274,8 +301,33 @@ public GetAzMarketplaceTerms_Get1() 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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -328,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -349,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Publisher=Publisher,Product=Product,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Publisher=Publisher,Product=Product,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 ) { @@ -409,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.MarketplaceOrdering.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Publisher=Publisher, Product=Product, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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, Publisher=Publisher, Product=Product, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -427,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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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 ) { @@ -444,8 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_Sign.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_Sign.cs index 406841ca5fa4..b52aae7061b0 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_Sign.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_Sign.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; using System; /// Sign marketplace terms. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets /// [OpenAPI] Sign=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzMarketplaceSignTerms_Sign", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Sign marketplace terms.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign", ApiVersion = "2021-01-01")] public partial class InvokeAzMarketplaceSignTerms_Sign : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 InvokeAzMarketplaceSignTerms_Sign : global::System.Manageme /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first 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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class InvokeAzMarketplaceSignTerms_Sign : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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] @@ -92,7 +113,7 @@ public partial class InvokeAzMarketplaceSignTerms_Sign : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _product; @@ -152,7 +173,8 @@ public partial class InvokeAzMarketplaceSignTerms_Sign : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -161,24 +183,24 @@ public partial class InvokeAzMarketplaceSignTerms_Sign : 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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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) @@ -201,6 +223,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.MarketplaceOrdering.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -222,7 +249,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzMarketplaceSignTerms_Sign() { @@ -273,8 +300,33 @@ public InvokeAzMarketplaceSignTerms_Sign() 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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +382,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -348,7 +400,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Publisher=Publisher,Product=Product,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Publisher=Publisher,Product=Product,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -386,12 +438,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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 ) { @@ -408,15 +460,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.MarketplaceOrdering.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Publisher=Publisher, Product=Product, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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, Publisher=Publisher, Product=Product, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -426,12 +478,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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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 ) { @@ -443,8 +495,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentity.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentity.cs index 26a4f43e8db3..b65319fe2c23 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentity.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; using System; /// Sign marketplace terms. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets /// [OpenAPI] Sign=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzMarketplaceSignTerms_SignViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Sign marketplace terms.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign", ApiVersion = "2021-01-01")] public partial class InvokeAzMarketplaceSignTerms_SignViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 InvokeAzMarketplaceSignTerms_SignViaIdentity : global::Syst /// 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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class InvokeAzMarketplaceSignTerms_SignViaIdentity : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 InvokeAzMarketplaceSignTerms_SignViaIdentity : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 InvokeAzMarketplaceSignTerms_SignViaIdentity : 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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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.MarketplaceOrdering.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 InvokeAzMarketplaceSignTerms_SignViaIdentity() { @@ -221,8 +247,33 @@ public InvokeAzMarketplaceSignTerms_SignViaIdentity() 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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -278,7 +329,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -320,7 +371,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 } }); @@ -358,12 +409,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 ) { @@ -380,7 +431,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.MarketplaceOrdering.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 } @@ -398,12 +449,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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 ) { @@ -415,8 +466,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentityAgreement.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentityAgreement.cs new file mode 100644 index 000000000000..e126f0f5d447 --- /dev/null +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentityAgreement.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; + using System; + + /// Sign marketplace terms. + /// + /// [OpenAPI] Sign=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzMarketplaceSignTerms_SignViaIdentityAgreement", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Sign marketplace terms.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign", ApiVersion = "2021-01-01")] + public partial class InvokeAzMarketplaceSignTerms_SignViaIdentityAgreement : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity _agreementInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity AgreementInputObject { get => this._agreementInputObject; set => this._agreementInputObject = 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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Plan identifier string of image being deployed. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Plan identifier string of image being deployed.")] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Plan identifier string of image being deployed.", + SerializedName = @"planId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _product; + + /// Offer identifier string of image being deployed. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Offer identifier string of image being deployed.")] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Offer identifier string of image being deployed.", + SerializedName = @"offerId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] + public string Product { get => this._product; set => this._product = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + /// 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.MarketplaceOrdering.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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 InvokeAzMarketplaceSignTerms_SignViaIdentityAgreement() + { + + } + + /// 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.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MarketplaceAgreementsSign' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (AgreementInputObject?.Id != null) + { + this.AgreementInputObject.Id += $"/offers/{(global::System.Uri.EscapeDataString(this.Product.ToString()))}/plans/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.MarketplaceAgreementsSignViaIdentity(AgreementInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == AgreementInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("AgreementInputObject has null value for AgreementInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, AgreementInputObject) ); + } + if (null == AgreementInputObject.PublisherId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("AgreementInputObject has null value for AgreementInputObject.PublisherId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, AgreementInputObject) ); + } + await this.Client.MarketplaceAgreementsSign(AgreementInputObject.SubscriptionId ?? null, AgreementInputObject.PublisherId ?? null, Product, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Product=Product,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IAgreementTerms + /// 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.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentityOffer.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentityOffer.cs new file mode 100644 index 000000000000..7d4ed65878c9 --- /dev/null +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/InvokeAzMarketplaceSignTerms_SignViaIdentityOffer.cs @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; + using System; + + /// Sign marketplace terms. + /// + /// [OpenAPI] Sign=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzMarketplaceSignTerms_SignViaIdentityOffer", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Sign marketplace terms.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/sign", ApiVersion = "2021-01-01")] + public partial class InvokeAzMarketplaceSignTerms_SignViaIdentityOffer : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Plan identifier string of image being deployed. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Plan identifier string of image being deployed.")] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Plan identifier string of image being deployed.", + SerializedName = @"planId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity _offerInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity OfferInputObject { get => this._offerInputObject; set => this._offerInputObject = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + /// 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.MarketplaceOrdering.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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 InvokeAzMarketplaceSignTerms_SignViaIdentityOffer() + { + + } + + /// 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.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MarketplaceAgreementsSign' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (OfferInputObject?.Id != null) + { + this.OfferInputObject.Id += $"/plans/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.MarketplaceAgreementsSignViaIdentity(OfferInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == OfferInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("OfferInputObject has null value for OfferInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, OfferInputObject) ); + } + if (null == OfferInputObject.PublisherId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("OfferInputObject has null value for OfferInputObject.PublisherId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, OfferInputObject) ); + } + if (null == OfferInputObject.OfferId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("OfferInputObject has null value for OfferInputObject.OfferId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, OfferInputObject) ); + } + await this.Client.MarketplaceAgreementsSign(OfferInputObject.SubscriptionId ?? null, OfferInputObject.PublisherId ?? null, OfferInputObject.OfferId ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IAgreementTerms + /// 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.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/SetAzMarketplaceTerms_Create.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/SetAzMarketplaceTerms_Create.cs index 63cee76274f3..e07c764d5d36 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/SetAzMarketplaceTerms_Create.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/SetAzMarketplaceTerms_Create.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; using System; /// Save marketplace terms. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"AzMarketplaceTerms_Create", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Save marketplace terms.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/offerTypes/{offerType}/publishers/{publisherId}/offers/{offerId}/plans/{planId}/agreements/current", ApiVersion = "2021-01-01")] public partial class SetAzMarketplaceTerms_Create : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,11 +38,26 @@ public partial class SetAzMarketplaceTerms_Create : 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 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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.ClientAPI; @@ -53,6 +71,9 @@ public partial class SetAzMarketplaceTerms_Create : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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] @@ -91,7 +112,7 @@ public partial class SetAzMarketplaceTerms_Create : global::System.Management.Au public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms _parameter; + private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms _parameter; /// Terms properties for provided Publisher/Offer/Plan tuple [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Terms properties for provided Publisher/Offer/Plan tuple", ValueFromPipeline = true)] @@ -100,13 +121,14 @@ public partial class SetAzMarketplaceTerms_Create : global::System.Management.Au ReadOnly = false, Description = @"Terms properties for provided Publisher/Offer/Plan tuple", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms) })] - public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms Parameter { get => this._parameter; set => this._parameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms Parameter { get => this._parameter; set => this._parameter = value; } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _product; @@ -166,7 +188,8 @@ public partial class SetAzMarketplaceTerms_Create : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -175,24 +198,24 @@ public partial class SetAzMarketplaceTerms_Create : 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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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) @@ -215,6 +238,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.MarketplaceOrdering.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -279,8 +307,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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -336,7 +389,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -349,12 +402,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MarketplaceAgreementsCreate(SubscriptionId, Publisher, Product, Name, Parameter, onOk, onDefault, this, Pipeline); + await this.Client.MarketplaceAgreementsCreate(SubscriptionId, Publisher, Product, Name, Parameter, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Publisher=Publisher,Product=Product,Name=Name,body=Parameter}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Publisher=Publisher,Product=Product,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -367,7 +420,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public SetAzMarketplaceTerms_Create() { @@ -400,12 +453,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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 ) { @@ -422,15 +475,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.MarketplaceOrdering.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Publisher=Publisher, Product=Product, Name=Name, body=Parameter }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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, Publisher=Publisher, Product=Product, Name=Name, body=Parameter }) + 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 } }); @@ -440,12 +493,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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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 ) { @@ -457,8 +510,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_Cancel.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_Cancel.cs index 6cb95484b51b..a8f7a673a5ba 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_Cancel.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_Cancel.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; using System; /// Cancel marketplace terms. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzMarketplaceTerms_Cancel", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Cancel marketplace terms.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel", ApiVersion = "2021-01-01")] public partial class StopAzMarketplaceTerms_Cancel : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 StopAzMarketplaceTerms_Cancel : global::System.Management.A /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class StopAzMarketplaceTerms_Cancel : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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] @@ -92,7 +113,7 @@ public partial class StopAzMarketplaceTerms_Cancel : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _product; @@ -152,7 +173,8 @@ public partial class StopAzMarketplaceTerms_Cancel : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -161,24 +183,24 @@ public partial class StopAzMarketplaceTerms_Cancel : global::System.Management.A /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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) @@ -201,6 +223,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.MarketplaceOrdering.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -265,8 +292,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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -322,7 +374,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -340,7 +392,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Publisher=Publisher,Product=Product,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Publisher=Publisher,Product=Product,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,7 +405,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzMarketplaceTerms_Cancel() { @@ -386,12 +438,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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 ) { @@ -408,15 +460,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.MarketplaceOrdering.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Publisher=Publisher, Product=Product, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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, Publisher=Publisher, Product=Product, Name=Name }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -426,12 +478,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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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 ) { @@ -443,8 +495,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentity.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentity.cs index 540a7a3abd90..ef8255604f14 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentity.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; using System; /// Cancel marketplace terms. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzMarketplaceTerms_CancelViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Cancel marketplace terms.")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel", ApiVersion = "2021-01-01")] public partial class StopAzMarketplaceTerms_CancelViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 StopAzMarketplaceTerms_CancelViaIdentity : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class StopAzMarketplaceTerms_CancelViaIdentity : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 StopAzMarketplaceTerms_CancelViaIdentity : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 StopAzMarketplaceTerms_CancelViaIdentity : 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.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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.MarketplaceOrdering.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -213,8 +239,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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -270,7 +321,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,7 +363,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 } }); @@ -325,7 +376,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzMarketplaceTerms_CancelViaIdentity() { @@ -358,12 +409,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 ) { @@ -380,7 +431,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.MarketplaceOrdering.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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 } @@ -398,12 +449,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms /// 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 ) { @@ -415,8 +466,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentityAgreement.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentityAgreement.cs new file mode 100644 index 000000000000..4a809bbed432 --- /dev/null +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentityAgreement.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; + using System; + + /// Cancel marketplace terms. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzMarketplaceTerms_CancelViaIdentityAgreement", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Cancel marketplace terms.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel", ApiVersion = "2021-01-01")] + public partial class StopAzMarketplaceTerms_CancelViaIdentityAgreement : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity _agreementInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity AgreementInputObject { get => this._agreementInputObject; set => this._agreementInputObject = 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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Plan identifier string of image being deployed. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Plan identifier string of image being deployed.")] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Plan identifier string of image being deployed.", + SerializedName = @"planId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _product; + + /// Offer identifier string of image being deployed. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Offer identifier string of image being deployed.")] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Offer identifier string of image being deployed.", + SerializedName = @"offerId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] + public string Product { get => this._product; set => this._product = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + /// 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.MarketplaceOrdering.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MarketplaceAgreementsCancel' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (AgreementInputObject?.Id != null) + { + this.AgreementInputObject.Id += $"/offers/{(global::System.Uri.EscapeDataString(this.Product.ToString()))}/plans/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.MarketplaceAgreementsCancelViaIdentity(AgreementInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == AgreementInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("AgreementInputObject has null value for AgreementInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, AgreementInputObject) ); + } + if (null == AgreementInputObject.PublisherId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("AgreementInputObject has null value for AgreementInputObject.PublisherId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, AgreementInputObject) ); + } + await this.Client.MarketplaceAgreementsCancel(AgreementInputObject.SubscriptionId ?? null, AgreementInputObject.PublisherId ?? null, Product, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Product=Product,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public StopAzMarketplaceTerms_CancelViaIdentityAgreement() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IAgreementTerms + /// 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.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentityOffer.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentityOffer.cs new file mode 100644 index 000000000000..37297586d15d --- /dev/null +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/cmdlets/StopAzMarketplaceTerms_CancelViaIdentityOffer.cs @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Cmdlets; + using System; + + /// Cancel marketplace terms. + /// + /// [OpenAPI] Cancel=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzMarketplaceTerms_CancelViaIdentityOffer", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms))] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Description(@"Cancel marketplace terms.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.MarketplaceOrdering/agreements/{publisherId}/offers/{offerId}/plans/{planId}/cancel", ApiVersion = "2021-01-01")] + public partial class StopAzMarketplaceTerms_CancelViaIdentityOffer : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Plan identifier string of image being deployed. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Plan identifier string of image being deployed.")] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Plan identifier string of image being deployed.", + SerializedName = @"planId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity _offerInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IMarketplaceOrderingIdentity OfferInputObject { get => this._offerInputObject; set => this._offerInputObject = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Category(global::Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms + /// 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.MarketplaceOrdering.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MarketplaceAgreementsCancel' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (OfferInputObject?.Id != null) + { + this.OfferInputObject.Id += $"/plans/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.MarketplaceAgreementsCancelViaIdentity(OfferInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == OfferInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("OfferInputObject has null value for OfferInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, OfferInputObject) ); + } + if (null == OfferInputObject.PublisherId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("OfferInputObject has null value for OfferInputObject.PublisherId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, OfferInputObject) ); + } + if (null == OfferInputObject.OfferId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("OfferInputObject has null value for OfferInputObject.OfferId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, OfferInputObject) ); + } + await this.Client.MarketplaceAgreementsCancel(OfferInputObject.SubscriptionId ?? null, OfferInputObject.PublisherId ?? null, OfferInputObject.OfferId ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public StopAzMarketplaceTerms_CancelViaIdentityOffer() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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.MarketplaceOrdering.Models.IAgreementTerms + /// 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.MarketplaceOrdering.Models.IAgreementTerms + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..fd6f8d0a3507 --- /dev/null +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering +{ + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..60c2a837905c --- /dev/null +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering +{ + 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 99cc36d750dd..03fc0a19d71a 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 218333b5d268..672dfdd4fa5b 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 827f2c0fff0c..14aa846633e9 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 922712d25108..5a35ec2c1d1b 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 2c55f633b401..1612b016ce29 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index bfb0ae192375..f33cf1fd0c4f 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 99ba36b93911..2bc0d1df859b 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 52501a542ae3..6f2192637b69 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 045b68266808..8b0eb0b338c8 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 9a2b2839918c..c523bb14f04f 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/PsExtensions.cs index dd8201bcb29a..0b89531efc12 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PowerSh { 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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 3a6d3206f80d..1f270a4e1fde 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Context.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..b02b5376401a --- /dev/null +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.MarketplaceOrdering Client { get; } + } +} diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Events.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Events.cs index 6015896e5f9e..088212857866 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Events.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/ISendAsync.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/ISendAsync.cs index b48f1b69254f..d7ec3821578b 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/InfoAttribute.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/InfoAttribute.cs index c6da7ed4e590..c96be9d2de87 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/InputHandler.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..b963a8067c12 --- /dev/null +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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.MarketplaceOrdering.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.MarketplaceOrdering.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 92e983cf6b99..4cb74fdd68fd 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/SerializationMode.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/SerializationMode.cs index 6cc0b8543222..e5c669ddb8eb 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/TypeConverterExtensions.cs index ceacef50661f..2d6f65785a12 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Get-AzMarketplaceOperation.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Get-AzMarketplaceOperation.ps1 index f043ecc59b1b..f69a3683a8fb 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Get-AzMarketplaceOperation.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Get-AzMarketplaceOperation.ps1 @@ -25,12 +25,12 @@ Lists all of the available Microsoft.MarketplaceOrdering REST API operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.marketplaceordering/get-azmarketplaceoperation #> function Get-AzMarketplaceOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.MarketplaceOrdering.private\Get-AzMarketplaceOperation_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/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Get-AzMarketplaceTerms.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Get-AzMarketplaceTerms.ps1 index 819bd374adae..09eacc0ca3db 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Get-AzMarketplaceTerms.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Get-AzMarketplaceTerms.ps1 @@ -25,12 +25,12 @@ Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-scienc Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science-vm" -Name "windows2016" -OfferType 'virtualmachine' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Link https://learn.microsoft.com/powershell/module/az.marketplaceordering/get-azmarketplaceterms #> function Get-AzMarketplaceTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -114,14 +114,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.MarketplaceOrdering.private\Get-AzMarketplaceTerms_Get'; Get1 = 'Az.MarketplaceOrdering.private\Get-AzMarketplaceTerms_Get1'; } - if (('Get', 'Get1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'Get1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -130,6 +131,9 @@ begin { } $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/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/ProxyCmdletDefinitions.ps1 index 237fd0744d5b..33c9a2a1b346 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -25,12 +25,12 @@ Lists all of the available Microsoft.MarketplaceOrdering REST API operations. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.marketplaceordering/get-azmarketplaceoperation #> function Get-AzMarketplaceOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -89,12 +89,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.MarketplaceOrdering.private\Get-AzMarketplaceOperation_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) @@ -135,12 +141,12 @@ Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-scienc Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science-vm" -Name "windows2016" -OfferType 'virtualmachine' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Link https://learn.microsoft.com/powershell/module/az.marketplaceordering/get-azmarketplaceterms #> function Get-AzMarketplaceTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -224,14 +230,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Get = 'Az.MarketplaceOrdering.private\Get-AzMarketplaceTerms_Get'; Get1 = 'Az.MarketplaceOrdering.private\Get-AzMarketplaceTerms_Get1'; } - if (('Get', 'Get1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'Get1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -240,6 +247,9 @@ begin { } $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) @@ -284,9 +294,9 @@ Set-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-scienc Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science-vm" -Name "windows2016" -OfferType 'virtualmachine' | Set-AzMarketplaceTerms -Reject .Inputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Notes COMPLEX PARAMETER PROPERTIES @@ -302,17 +312,11 @@ PARAMETER : Terms properties for provided Publisher/Offer/Plan [Publisher ]: Publisher identifier string of image being deployed. [RetrieveDatetime ]: Date and time in UTC of when the terms were accepted. This is empty if Accepted is false. [Signature ]: Terms signature. - [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). - [SystemDataCreatedBy ]: The identity that created the resource. - [SystemDataCreatedByType ]: The type of identity that created the resource. - [SystemDataLastModifiedAt ]: The timestamp of resource last modification (UTC) - [SystemDataLastModifiedBy ]: The identity that last modified the resource. - [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. .Link https://learn.microsoft.com/powershell/module/az.marketplaceordering/set-azmarketplaceterms #> function Set-AzMarketplaceTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='Create', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -342,9 +346,8 @@ param( [Parameter(Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms] # Terms properties for provided Publisher/Offer/Plan tuple - # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter()] @@ -403,13 +406,14 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Create = 'Az.MarketplaceOrdering.private\Set-AzMarketplaceTerms_Create'; } - if (('Create') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Create') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -418,6 +422,9 @@ begin { } $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/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Set-AzMarketplaceTerms.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Set-AzMarketplaceTerms.ps1 index 73bb1e009052..6b5708704005 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Set-AzMarketplaceTerms.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/internal/Set-AzMarketplaceTerms.ps1 @@ -29,9 +29,9 @@ Set-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-scienc Get-AzMarketplaceTerms -Publisher "microsoft-ads" -Product "windows-data-science-vm" -Name "windows2016" -OfferType 'virtualmachine' | Set-AzMarketplaceTerms -Reject .Inputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Outputs -Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms +Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms .Notes COMPLEX PARAMETER PROPERTIES @@ -47,17 +47,11 @@ PARAMETER : Terms properties for provided Publisher/Offer/Plan [Publisher ]: Publisher identifier string of image being deployed. [RetrieveDatetime ]: Date and time in UTC of when the terms were accepted. This is empty if Accepted is false. [Signature ]: Terms signature. - [SystemDataCreatedAt ]: The timestamp of resource creation (UTC). - [SystemDataCreatedBy ]: The identity that created the resource. - [SystemDataCreatedByType ]: The type of identity that created the resource. - [SystemDataLastModifiedAt ]: The timestamp of resource last modification (UTC) - [SystemDataLastModifiedBy ]: The identity that last modified the resource. - [SystemDataLastModifiedByType ]: The type of identity that last modified the resource. .Link https://learn.microsoft.com/powershell/module/az.marketplaceordering/set-azmarketplaceterms #> function Set-AzMarketplaceTerms { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms])] [CmdletBinding(DefaultParameterSetName='Create', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -87,9 +81,8 @@ param( [Parameter(Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.Api202101.IAgreementTerms] + [Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Models.IAgreementTerms] # Terms properties for provided Publisher/Offer/Plan tuple - # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, [Parameter()] @@ -148,13 +141,14 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ Create = 'Az.MarketplaceOrdering.private\Set-AzMarketplaceTerms_Create'; } - if (('Create') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Create') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -163,6 +157,9 @@ begin { } $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/MarketplaceOrdering/MarketplaceOrdering.Autorest/resources/README.md b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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/MarketplaceOrdering/MarketplaceOrdering.Autorest/test-module.ps1 b/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/test-module.ps1 index 16820f5531e3..afa0059c743a 100644 --- a/generated/MarketplaceOrdering/MarketplaceOrdering.Autorest/test-module.ps1 +++ b/generated/MarketplaceOrdering/MarketplaceOrdering.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-------------'