diff --git a/src/BareMetal/Az.BareMetal.csproj b/src/BareMetal/Az.BareMetal.csproj
new file mode 100644
index 000000000000..b7d3cb06a7c0
--- /dev/null
+++ b/src/BareMetal/Az.BareMetal.csproj
@@ -0,0 +1,7 @@
+
+
+ BareMetal
+
+
+
+
diff --git a/src/BareMetal/Az.BareMetal.format.ps1xml b/src/BareMetal/Az.BareMetal.format.ps1xml
new file mode 100644
index 000000000000..834b5b2a3569
--- /dev/null
+++ b/src/BareMetal/Az.BareMetal.format.ps1xml
@@ -0,0 +1,579 @@
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.BareMetalIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.BareMetalIdentity
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AzureBareMetalInstanceName
+
+
+ ResourceGroupName
+
+
+ SubscriptionId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstance
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstance
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+ Name
+
+
+ ResourceGroupName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AzureBareMetalInstanceId
+
+
+ HwRevision
+
+
+ PartnerNodeId
+
+
+ PowerState
+
+
+ ProvisioningState
+
+
+ ProximityPlacementGroup
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancesListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancesListResult
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Disk
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Disk
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Lun
+
+
+ Name
+
+
+ SizeGb
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Display
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Display
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ Operation
+
+
+ Provider
+
+
+ Resource
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfile
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AzureBareMetalInstanceSize
+
+
+ HardwareType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddress
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddress
+
+
+
+
+
+
+
+
+
+
+
+ IPAddress1
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfile
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfile
+
+
+
+
+
+
+
+
+
+
+
+ CircuitId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Operation
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Operation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IsDataAction
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfile
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ComputerName
+
+
+ OSType
+
+
+ SshPublicKey
+
+
+ Version
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Result
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Result
+
+
+
+
+
+
+
+
+
+
+
+ SampleProperty
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfile
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfile
+
+
+
+
+
+
+
+
+
+
+
+ NfsIPAddress
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.Resource
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.Resource
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemData
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CreatedAt
+
+
+ CreatedBy
+
+
+ CreatedByType
+
+
+ LastModifiedAt
+
+
+ LastModifiedBy
+
+
+ LastModifiedByType
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Location
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/BareMetal/Az.BareMetal.psd1 b/src/BareMetal/Az.BareMetal.psd1
new file mode 100644
index 000000000000..8c89a1ae9079
--- /dev/null
+++ b/src/BareMetal/Az.BareMetal.psd1
@@ -0,0 +1,132 @@
+#
+# Module manifest for module 'Az.BareMetal'
+#
+# Generated by: Microsoft Corporation
+#
+# Generated on: 2/24/2022
+#
+
+@{
+
+# Script module or binary module file associated with this manifest.
+RootModule = './Az.BareMetal.psm1'
+
+# Version number of this module.
+ModuleVersion = '0.1.0'
+
+# Supported PSEditions
+CompatiblePSEditions = 'Core', 'Desktop'
+
+# ID used to uniquely identify this module
+GUID = '4b038ccd-b128-4b3d-be04-8a9921c69093'
+
+# Author of this module
+Author = 'Microsoft Corporation'
+
+# Company or vendor of this module
+CompanyName = 'Microsoft Corporation'
+
+# Copyright statement for this module
+Copyright = 'Microsoft Corporation. All rights reserved.'
+
+# Description of the functionality provided by this module
+Description = 'Microsoft Azure PowerShell: BareMetal cmdlets'
+
+# Minimum version of the PowerShell engine required by this module
+PowerShellVersion = '5.1'
+
+# Name of the PowerShell host required by this module
+# PowerShellHostName = ''
+
+# Minimum version of the PowerShell host required by this module
+# PowerShellHostVersion = ''
+
+# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
+DotNetFrameworkVersion = '4.7.2'
+
+# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
+# ClrVersion = ''
+
+# Processor architecture (None, X86, Amd64) required by this module
+# ProcessorArchitecture = ''
+
+# Modules that must be imported into the global environment prior to importing this module
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.7.2'; })
+
+# Assemblies that must be loaded prior to importing this module
+RequiredAssemblies = './bin/Az.BareMetal.private.dll'
+
+# Script files (.ps1) that are run in the caller's environment prior to importing this module.
+# ScriptsToProcess = @()
+
+# Type files (.ps1xml) to be loaded when importing this module
+# TypesToProcess = @()
+
+# Format files (.ps1xml) to be loaded when importing this module
+FormatsToProcess = './Az.BareMetal.format.ps1xml'
+
+# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
+# NestedModules = @()
+
+# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
+FunctionsToExport = 'Get-AzBareMetal', 'Update-AzBareMetal'
+
+# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
+CmdletsToExport = @()
+
+# Variables to export from this module
+# VariablesToExport = @()
+
+# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
+AliasesToExport = '*'
+
+# DSC resources to export from this module
+# DscResourcesToExport = @()
+
+# List of all modules packaged with this module
+# ModuleList = @()
+
+# List of all files packaged with this module
+# FileList = @()
+
+# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
+PrivateData = @{
+
+ PSData = @{
+
+ # Tags applied to this module. These help with module discovery in online galleries.
+ Tags = 'Azure','ResourceManager','ARM','PSModule','BareMetal'
+
+ # A URL to the license for this module.
+ LicenseUri = 'https://aka.ms/azps-license'
+
+ # A URL to the main website for this project.
+ ProjectUri = 'https://github.com/Azure/azure-powershell'
+
+ # A URL to an icon representing this module.
+ # IconUri = ''
+
+ # ReleaseNotes of this module
+ # ReleaseNotes = ''
+
+ # Prerelease string of this module
+ # Prerelease = ''
+
+ # Flag to indicate whether the module requires explicit user acceptance for install/update/save
+ # RequireLicenseAcceptance = $false
+
+ # External dependent modules of this module
+ # ExternalModuleDependencies = @()
+
+ } # End of PSData hashtable
+
+ } # End of PrivateData hashtable
+
+# HelpInfo URI of this module
+# HelpInfoURI = ''
+
+# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
+# DefaultCommandPrefix = ''
+
+}
+
diff --git a/src/BareMetal/Az.BareMetal.psm1 b/src/BareMetal/Az.BareMetal.psm1
new file mode 100644
index 000000000000..e516f6959142
--- /dev/null
+++ b/src/BareMetal/Az.BareMetal.psm1
@@ -0,0 +1,111 @@
+# region Generated
+ # ----------------------------------------------------------------------------------
+ # 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,
+# 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.
+ # ----------------------------------------------------------------------------------
+ # Load required Az.Accounts module
+ $accountsName = 'Az.Accounts'
+ $accountsModule = Get-Module -Name $accountsName
+ if(-not $accountsModule) {
+ $localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
+ if(Test-Path -Path $localAccountsPath) {
+ $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
+ if($localAccounts) {
+ $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
+ }
+ }
+ if(-not $accountsModule) {
+ $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0
+ if($hasAdequateVersion) {
+ $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.2.3 -Scope Global -PassThru
+ }
+ }
+ }
+
+ if(-not $accountsModule) {
+ Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
+ } elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) {
+ Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
+ }
+ Write-Information "Loaded Module '$($accountsModule.Name)'"
+
+ # Load the private module dll
+ $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.BareMetal.private.dll')
+
+ # Get the private module's instance
+ $instance = [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module]::Instance
+
+ # Ask for the shared functionality table
+ $VTable = Register-AzModule
+
+ # Tweaks the pipeline on module load
+ $instance.OnModuleLoad = $VTable.OnModuleLoad
+
+
+ # Tweaks the pipeline per call
+ $instance.OnNewRequest = $VTable.OnNewRequest
+
+ # Gets shared parameter values
+ $instance.GetParameterValue = $VTable.GetParameterValue
+
+ # Allows shared module to listen to events from this module
+ $instance.EventListener = $VTable.EventListener
+
+ # Gets shared argument completers
+ $instance.ArgumentCompleter = $VTable.ArgumentCompleter
+
+ # The name of the currently selected Azure profile
+ $instance.ProfileName = $VTable.ProfileName
+
+
+ # Load the custom module
+ $customModulePath = Join-Path $PSScriptRoot './custom/Az.BareMetal.custom.psm1'
+ if(Test-Path $customModulePath) {
+ $null = Import-Module -Name $customModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export proxy cmdlet scripts
+ $exportsPath = Join-Path $PSScriptRoot './exports'
+ $directories = Get-ChildItem -Directory -Path $exportsPath
+ $profileDirectory = $null
+ if($instance.ProfileName) {
+ if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
+ $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
+ } else {
+ # Don't export anything if the profile doesn't exist for the module
+ $exportsPath = $null
+ Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
+ }
+ } elseif(($directories | Measure-Object).Count -gt 0) {
+ # Load the last folder if no profile is selected
+ $profileDirectory = $directories | Select-Object -Last 1
+ }
+
+ if($profileDirectory) {
+ Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
+ $exportsPath = $profileDirectory.FullName
+ }
+
+ if($exportsPath) {
+ Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
+ Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
+ }
+
+ # Finalize initialization of this module
+ $instance.Init();
+ Write-Information "Loaded Module '$($instance.Name)'"
+# endregion
diff --git a/src/BareMetal/BareMetal.sln b/src/BareMetal/BareMetal.sln
new file mode 100644
index 000000000000..79e883f1d378
--- /dev/null
+++ b/src/BareMetal/BareMetal.sln
@@ -0,0 +1,104 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30114.105
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{490A894A-DE34-4D54-86F3-2BD79ED68267}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{389B4D95-134E-44ED-9E28-E85D0FA4E77D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{8A5ADC33-0803-48B4-8351-2574EBFE3956}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{B2CF646C-1514-41E2-9501-5FA563DC0689}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.BareMetal", "Az.BareMetal.csproj", "{DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Debug|x64.Build.0 = Debug|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Debug|x86.Build.0 = Debug|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Release|Any CPU.Build.0 = Release|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Release|x64.ActiveCfg = Release|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Release|x64.Build.0 = Release|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Release|x86.ActiveCfg = Release|Any CPU
+ {490A894A-DE34-4D54-86F3-2BD79ED68267}.Release|x86.Build.0 = Release|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Debug|x64.Build.0 = Debug|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Debug|x86.Build.0 = Debug|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Release|x64.ActiveCfg = Release|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Release|x64.Build.0 = Release|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Release|x86.ActiveCfg = Release|Any CPU
+ {389B4D95-134E-44ED-9E28-E85D0FA4E77D}.Release|x86.Build.0 = Release|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Debug|x64.Build.0 = Debug|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Debug|x86.Build.0 = Debug|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Release|x64.ActiveCfg = Release|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Release|x64.Build.0 = Release|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Release|x86.ActiveCfg = Release|Any CPU
+ {8A5ADC33-0803-48B4-8351-2574EBFE3956}.Release|x86.Build.0 = Release|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Debug|x64.Build.0 = Debug|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Debug|x86.Build.0 = Debug|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Release|x64.ActiveCfg = Release|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Release|x64.Build.0 = Release|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Release|x86.ActiveCfg = Release|Any CPU
+ {B2CF646C-1514-41E2-9501-5FA563DC0689}.Release|x86.Build.0 = Release|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Debug|x64.Build.0 = Debug|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Debug|x86.Build.0 = Debug|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Release|x64.ActiveCfg = Release|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Release|x64.Build.0 = Release|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Release|x86.ActiveCfg = Release|Any CPU
+ {23BC8A23-3BE3-47DE-B1D4-738D41F23B9A}.Release|x86.Build.0 = Release|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Debug|x64.Build.0 = Debug|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Debug|x86.Build.0 = Debug|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Release|x64.ActiveCfg = Release|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Release|x64.Build.0 = Release|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Release|x86.ActiveCfg = Release|Any CPU
+ {DB3D9D19-68E4-4FB3-8E10-A9E188FFAA55}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/src/BareMetal/Changelog.md b/src/BareMetal/Changelog.md
new file mode 100644
index 000000000000..87483b279839
--- /dev/null
+++ b/src/BareMetal/Changelog.md
@@ -0,0 +1,24 @@
+
+## Upcoming Release
+
+## Version 0.1.0
+* First preview release for module Az.BareMetal
+
diff --git a/src/BareMetal/Properties/AssemblyInfo.cs b/src/BareMetal/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000000..5f8738bebda8
--- /dev/null
+++ b/src/BareMetal/Properties/AssemblyInfo.cs
@@ -0,0 +1,28 @@
+// ----------------------------------------------------------------------------------
+//
+// 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.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Microsoft Azure Powershell - BareMetal")]
+[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("00c8021e-939a-481d-9afe-4b24402fe1ec")]
+[assembly: AssemblyVersion("0.1.0")]
+[assembly: AssemblyFileVersion("0.1.0")]
diff --git a/src/BareMetal/README.md b/src/BareMetal/README.md
new file mode 100644
index 000000000000..f3bdd3203d33
--- /dev/null
+++ b/src/BareMetal/README.md
@@ -0,0 +1,58 @@
+
+# Az.BareMetal
+This directory contains the PowerShell module for the BareMetal service.
+
+---
+## Status
+[](https://www.powershellgallery.com/packages/Az.BareMetal/)
+
+## Info
+- Modifiable: yes
+- Generated: all
+- Committed: yes
+- Packaged: yes
+
+---
+## Detail
+This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
+
+## Module Requirements
+- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater
+
+## Authentication
+AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
+
+## Development
+For information on how to develop for `Az.BareMetal`, see [how-to.md](how-to.md).
+
+
+
+### AutoRest Configuration
+> see https://aka.ms/autorest
+
+``` yaml
+branch: 1e42e81660d1bc0be000477a4659b29a7ce7d67b
+require:
+ - $(this-folder)/../readme.azure.noprofile.md
+input-file:
+ - $(repo)/specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/baremetalinfrastructure.json
+
+module-version: 0.1.0
+title: BareMetal
+subject-prefix: $(service-name)
+
+identity-correction-for-post: true
+resourcegroup-append: true
+nested-object-to-string: true
+
+directive:
+ - where:
+ subject: ^AzureBareMetalInstance(.*)
+ set:
+ subject: $1
+ - where:
+ variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^GetViaIdentity$
+ subject-prefix: BareMetal
+ remove: true
+
+```
diff --git a/src/BareMetal/build-module.ps1 b/src/BareMetal/build-module.ps1
new file mode 100644
index 000000000000..2c342b3f941f
--- /dev/null
+++ b/src/BareMetal/build-module.ps1
@@ -0,0 +1,161 @@
+# ----------------------------------------------------------------------------------
+# 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,
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
+$ErrorActionPreference = 'Stop'
+
+if($PSEdition -ne 'Core') {
+ Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
+}
+
+if(-not $Isolated -and -not $Debugger) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+
+ if($LastExitCode -ne 0) {
+ # Build failed. Don't attempt to run the module.
+ return
+ }
+
+ if($Test) {
+ . (Join-Path $PSScriptRoot 'test-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Tests failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Docs) {
+ . (Join-Path $PSScriptRoot 'generate-help.ps1')
+ if($LastExitCode -ne 0) {
+ # Docs generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Pack) {
+ . (Join-Path $PSScriptRoot 'pack-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Packing failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1'
+ if($Code) {
+ . $runModulePath -Code
+ } elseif($Run) {
+ . $runModulePath
+ } else {
+ Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script."
+ }
+ return
+}
+
+$binFolder = Join-Path $PSScriptRoot 'bin'
+$objFolder = Join-Path $PSScriptRoot 'obj'
+
+if(-not $Debugger) {
+ Write-Host -ForegroundColor Green 'Cleaning build folders...'
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
+
+ if((Test-Path $binFolder) -or (Test-Path $objFolder)) {
+ Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?'
+ Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.'
+ }
+
+ Write-Host -ForegroundColor Green 'Compiling module...'
+ $buildConfig = 'Debug'
+ if($Release) {
+ $buildConfig = 'Release'
+ }
+ dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo
+ if($LastExitCode -ne 0) {
+ Write-Error 'Compilation failed.'
+ }
+
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.BareMetal.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+
+# Load DLL to use build-time cmdlets
+$null = Import-Module -Name $dll
+
+$modulePaths = $dll
+$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.BareMetal.custom.psm1'
+if(Test-Path $customPsm1) {
+ $modulePaths = @($dll, $customPsm1)
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(Test-Path $exportsFolder) {
+ $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $exportsFolder
+
+$internalFolder = Join-Path $PSScriptRoot 'internal'
+if(Test-Path $internalFolder) {
+ $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $internalFolder
+
+$psd1 = Join-Path $PSScriptRoot './Az.BareMetal.psd1'
+$guid = Get-ModuleGuid -Psd1Path $psd1
+$moduleName = 'Az.BareMetal'
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+$null = New-Item -ItemType Directory -Force -Path $examplesFolder
+
+Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
+$modelCmdlets = @()
+if ($modelCmdlets.Count -gt 0) {
+ . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
+ CreateModelCmdlet($modelCmdlets)
+}
+
+if($NoDocs) {
+ Write-Host -ForegroundColor Green 'Creating exports...'
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder
+} else {
+ Write-Host -ForegroundColor Green 'Creating exports and docs...'
+ $moduleDescription = 'Microsoft Azure PowerShell: BareMetal cmdlets'
+ $docsFolder = Join-Path $PSScriptRoot 'docs'
+ if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+ }
+ $null = New-Item -ItemType Directory -Force -Path $docsFolder
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
+}
+
+Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
+$formatPs1xml = Join-Path $PSScriptRoot './Az.BareMetal.format.ps1xml'
+Export-FormatPs1xml -FilePath $formatPs1xml
+
+Write-Host -ForegroundColor Green 'Creating psd1...'
+$customFolder = Join-Path $PSScriptRoot 'custom'
+Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid
+
+Write-Host -ForegroundColor Green 'Creating test stubs...'
+$testFolder = Join-Path $PSScriptRoot 'test'
+$null = New-Item -ItemType Directory -Force -Path $testFolder
+Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder
+
+Write-Host -ForegroundColor Green 'Creating example stubs...'
+Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
diff --git a/src/BareMetal/check-dependencies.ps1 b/src/BareMetal/check-dependencies.ps1
new file mode 100644
index 000000000000..b02ae9135957
--- /dev/null
+++ b/src/BareMetal/check-dependencies.ps1
@@ -0,0 +1,65 @@
+# ----------------------------------------------------------------------------------
+# 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,
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
+$ErrorActionPreference = 'Stop'
+
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
+ if($predicate) {
+ $module = Get-Module -ListAvailable -Name $moduleName
+ if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
+ $null = New-Item -ItemType Directory -Force -Path $path
+ Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
+ if ($requiredVersion) {
+ Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
+ }elseif($versionMinimum) {
+ Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
+ } else {
+ Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
+ }
+ }
+ }
+}
+
+$ProgressPreference = 'SilentlyContinue'
+$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1
+
+$localModulesPath = Join-Path $PSScriptRoot 'generated\modules'
+if(Test-Path -Path $localModulesPath) {
+ $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
+}
+
+DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.2.3'
+DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
+
+$tools = Join-Path $PSScriptRoot 'tools'
+$resourceDir = Join-Path $tools 'Resources'
+$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1'
+
+if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) {
+ Write-Host -ForegroundColor Green "Building local Resource module used for test..."
+ Set-Location $resourceDir
+ $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources
+ $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/
+ Set-Location $HOME/.PSSharedModules/Resources
+ $null = .\build-module.ps1
+ Set-Location $PSScriptRoot
+}
diff --git a/src/BareMetal/create-model-cmdlets.ps1 b/src/BareMetal/create-model-cmdlets.ps1
new file mode 100644
index 000000000000..b7a90b8761c2
--- /dev/null
+++ b/src/BareMetal/create-model-cmdlets.ps1
@@ -0,0 +1,177 @@
+# ----------------------------------------------------------------------------------
+# 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,
+# 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.
+# ----------------------------------------------------------------------------------
+
+function CreateModelCmdlet {
+
+ param([string[]]$Models)
+
+ if ($Models.Count -eq 0)
+ {
+ return
+ }
+
+ $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
+ $ModuleName = 'Az.BareMetal'.Split(".")[1]
+ $OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
+ $null = New-Item -ItemType Directory -Force -Path $OutputDir
+
+ $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
+ $Content = ''
+ $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 )
+ { $Content += get-content $_.fullname -raw
+ } }
+
+ $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content)
+ $Nodes = $Tree.ChildNodes().ChildNodes()
+ foreach ($Model in $Models)
+ {
+ $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") }
+ if ($InterfaceNode.count -eq 0) {
+ continue
+ }
+ # through a queue, we iterate all the parent models.
+ $Queue = @($InterfaceNode)
+ $visited = @("I$Model")
+ $AllInterfaceNodes = @()
+ while ($Queue.count -ne 0)
+ {
+ $AllInterfaceNodes += $Queue[0]
+ # Baselist contains the direct parent models.
+ foreach ($parent in $Queue[0].BaseList.Types)
+ {
+ if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value)))
+ {
+ $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) })
+ $visited = [Array]$visited + $parent.Type.Right.Identifier.Value
+ }
+ }
+ $first, $Queue = $Queue
+ }
+
+ $Namespace = $InterfaceNode.Parent.Name
+ $ObjectType = $Model
+ $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
+ # remove duplicated module name
+ if ($ObjectType.StartsWith($ModuleName)) {
+ $ModulePrefix = ''
+ } else {
+ $ModulePrefix = $ModuleName
+ }
+ $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
+
+ $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string]
+ $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string]
+ foreach ($Node in $AllInterfaceNodes)
+ {
+ foreach ($Member in $Node.Members)
+ {
+ $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments
+ $Required = $false
+ $Description = ""
+ $Readonly = $False
+ foreach ($Argument in $Arguments)
+ {
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Required")
+ {
+ $Required = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Description")
+ {
+ $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"')
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly")
+ {
+ $Readonly = $Argument.Expression.Token.Value
+ }
+ }
+ if ($Readonly)
+ {
+ continue
+ }
+ $Identifier = $Member.Identifier.Value
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string]
+ if ($Required)
+ {
+ $ParameterDefinePropertyList.Add("Mandatory")
+ }
+ if ($Description -ne "")
+ {
+ $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"")
+ }
+ $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList)
+ # check whether completer is needed
+ $completer = '';
+ if($Type.Split('.').Split('.')[-2] -eq 'Support') {
+ $completer += "`n [ArgumentCompleter([${Type}])]"
+ }
+ $ParameterDefineScript = "
+ [Parameter($ParameterDefineProperty)]${completer}
+ [${Type}]
+ `$${Identifier}"
+ $ParameterDefineScriptList.Add($ParameterDefineScript)
+ $ParameterAssignScriptList.Add("
+ if (`$PSBoundParameters.ContainsKey('${Identifier}')) {
+ `$Object.${Identifier} = `$${Identifier}
+ }")
+ }
+ }
+ $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator ","
+ $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator ""
+
+ $Script = "
+# ----------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the 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.
+# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
+# is regenerated.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Create an in-memory object for ${ObjectType}.
+.Description
+Create an in-memory object for ${ObjectType}.
+
+.Outputs
+${ObjectTypeWithNamespace}
+.Link
+https://docs.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
+#>
+function New-Az${ModulePrefix}${ObjectType}Object {
+ [OutputType('${ObjectTypeWithNamespace}')]
+ [CmdletBinding(PositionalBinding=`$false)]
+ Param(
+${ParameterDefineScript}
+ )
+
+ process {
+ `$Object = [${ObjectTypeWithNamespace}]::New()
+${ParameterAssignScript}
+ return `$Object
+ }
+}
+"
+ Set-Content -Path $OutputPath -Value $Script
+ }
+}
diff --git a/src/BareMetal/custom/Az.BareMetal.custom.psm1 b/src/BareMetal/custom/Az.BareMetal.custom.psm1
new file mode 100644
index 000000000000..eac72f537101
--- /dev/null
+++ b/src/BareMetal/custom/Az.BareMetal.custom.psm1
@@ -0,0 +1,17 @@
+# region Generated
+ # Load the private module dll
+ $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.BareMetal.private.dll')
+
+ # Load the internal module
+ $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.BareMetal.internal.psm1'
+ if(Test-Path $internalModulePath) {
+ $null = Import-Module -Name $internalModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export script cmdlets
+ Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias)
+# endregion
diff --git a/src/BareMetal/custom/README.md b/src/BareMetal/custom/README.md
new file mode 100644
index 000000000000..74d8642042d7
--- /dev/null
+++ b/src/BareMetal/custom/README.md
@@ -0,0 +1,41 @@
+# Custom
+This directory contains custom implementation for non-generated cmdlets for the `Az.BareMetal` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.BareMetal.custom.psm1`. This file should not be modified.
+
+## Info
+- Modifiable: yes
+- Generated: partial
+- Committed: yes
+- Packaged: yes
+
+## Details
+For `Az.BareMetal` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
+
+For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.BareMetal.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
+
+For script cmdlets, these are loaded via the `Az.BareMetal.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
+
+## Purpose
+This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
+
+## Usage
+The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
+- Break
+- DefaultProfile
+- HttpPipelineAppend
+- HttpPipelinePrepend
+- Proxy
+- ProxyCredential
+- ProxyUseDefaultCredentials
+
+These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.BareMetal`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
+
+### Attributes
+For processing the cmdlets, we've created some additional attributes:
+- `Microsoft.Azure.PowerShell.Cmdlets.BareMetal.DescriptionAttribute`
+ - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
+- `Microsoft.Azure.PowerShell.Cmdlets.BareMetal.DoNotExportAttribute`
+ - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.BareMetal`.
+- `Microsoft.Azure.PowerShell.Cmdlets.BareMetal.InternalExportAttribute`
+ - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.BareMetal`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
+- `Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ProfileAttribute`
+ - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
\ No newline at end of file
diff --git a/src/BareMetal/examples/Get-AzBareMetal.md b/src/BareMetal/examples/Get-AzBareMetal.md
new file mode 100644
index 000000000000..17465187b111
--- /dev/null
+++ b/src/BareMetal/examples/Get-AzBareMetal.md
@@ -0,0 +1,36 @@
+### Example 1: List
+```powershell
+PS C:\> Get-AzBareMetal
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+westus2 rhel79ora01 MWH03A-T210
+westus2 rhel79ora02 MWH03A-T210
+southcentralus oelnvmetest SAT09A-T230
+centraluseuap orcllabdsm01 DSM05A-T030
+```
+
+Gets Azure BareMetal instance.
+
+### Example 2: Get
+```powershell
+PS C:\> Get-AzBareMetal -Name oelnvmetest -ResourceGroupName SAT09A-T230
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+southcentralus oelnvmetest SAT09A-T230
+```
+
+Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
+
+### Example 3: List1
+```powershell
+PS C:\> Get-AzBareMetal -ResourceGroupName MWH03A-T210
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+westus2 rhel79ora01 MWH03A-T210
+westus2 rhel79ora02 MWH03A-T210
+```
+
+Gets Azure BareMetal instance for the resource group.
\ No newline at end of file
diff --git a/src/BareMetal/examples/Update-AzBareMetal.md b/src/BareMetal/examples/Update-AzBareMetal.md
new file mode 100644
index 000000000000..431cdc3e146f
--- /dev/null
+++ b/src/BareMetal/examples/Update-AzBareMetal.md
@@ -0,0 +1,21 @@
+### Example 1: UpdateExpanded
+```powershell
+PS C:\> Update-AzBareMetal -Name oraclerac53 -ResourceGroupName SAT09A-T530 -Tag @{"env"="test"}
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+southcentralus oraclerac53 SAT09A-T530
+```
+
+Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
+
+### Example 2: UpdateViaIdentityExpanded
+```powershell
+PS C:\> Get-AzBareMetal -Name oraclerac53 -ResourceGroupName SAT09A-T530 | Update-AzBareMetal -Tag @{"env"="test"}
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+southcentralus oraclerac53 SAT09A-T530
+```
+
+Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
\ No newline at end of file
diff --git a/src/BareMetal/export-surface.ps1 b/src/BareMetal/export-surface.ps1
new file mode 100644
index 000000000000..63a711c49be4
--- /dev/null
+++ b/src/BareMetal/export-surface.ps1
@@ -0,0 +1,41 @@
+# ----------------------------------------------------------------------------------
+# 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,
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.BareMetal.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+$null = Import-Module -Name $dll
+
+$moduleName = 'Az.BareMetal'
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+$resourcesFolder = Join-Path $PSScriptRoot 'resources'
+
+Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'"
+
+Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'"
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/BareMetal/exports/Get-AzBareMetal.ps1 b/src/BareMetal/exports/Get-AzBareMetal.ps1
new file mode 100644
index 000000000000..bd728c25fdd8
--- /dev/null
+++ b/src/BareMetal/exports/Get-AzBareMetal.ps1
@@ -0,0 +1,165 @@
+
+# ----------------------------------------------------------------------------------
+# 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,
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
+.Description
+Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
+.Example
+PS C:\> Get-AzBareMetal
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+westus2 rhel79ora01 MWH03A-T210
+westus2 rhel79ora02 MWH03A-T210
+southcentralus oelnvmetest SAT09A-T230
+centraluseuap orcllabdsm01 DSM05A-T030
+.Example
+PS C:\> Get-AzBareMetal -Name oelnvmetest -ResourceGroupName SAT09A-T230
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+southcentralus oelnvmetest SAT09A-T230
+.Example
+PS C:\> Get-AzBareMetal -ResourceGroupName MWH03A-T210
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+westus2 rhel79ora01 MWH03A-T210
+westus2 rhel79ora02 MWH03A-T210
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance
+.Link
+https://docs.microsoft.com/powershell/module/az.baremetal/get-azbaremetal
+#>
+function Get-AzBareMetal {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('AzureBareMetalInstanceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [System.String]
+ # Name of the Azure BareMetal on Azure instance.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.BareMetal.private\Get-AzBareMetal_Get';
+ List = 'Az.BareMetal.private\Get-AzBareMetal_List';
+ List1 = 'Az.BareMetal.private\Get-AzBareMetal_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/BareMetal/exports/ProxyCmdletDefinitions.ps1 b/src/BareMetal/exports/ProxyCmdletDefinitions.ps1
new file mode 100644
index 000000000000..59f52616fde0
--- /dev/null
+++ b/src/BareMetal/exports/ProxyCmdletDefinitions.ps1
@@ -0,0 +1,329 @@
+
+# ----------------------------------------------------------------------------------
+# 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,
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
+.Description
+Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
+.Example
+PS C:\> Get-AzBareMetal
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+westus2 rhel79ora01 MWH03A-T210
+westus2 rhel79ora02 MWH03A-T210
+southcentralus oelnvmetest SAT09A-T230
+centraluseuap orcllabdsm01 DSM05A-T030
+.Example
+PS C:\> Get-AzBareMetal -Name oelnvmetest -ResourceGroupName SAT09A-T230
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+southcentralus oelnvmetest SAT09A-T230
+.Example
+PS C:\> Get-AzBareMetal -ResourceGroupName MWH03A-T210
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+westus2 rhel79ora01 MWH03A-T210
+westus2 rhel79ora02 MWH03A-T210
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance
+.Link
+https://docs.microsoft.com/powershell/module/az.baremetal/get-azbaremetal
+#>
+function Get-AzBareMetal {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance])]
+[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('AzureBareMetalInstanceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [System.String]
+ # Name of the Azure BareMetal on Azure instance.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List1', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ Get = 'Az.BareMetal.private\Get-AzBareMetal_Get';
+ List = 'Az.BareMetal.private\Get-AzBareMetal_List';
+ List1 = 'Az.BareMetal.private\Get-AzBareMetal_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
+.Description
+Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
+.Example
+PS C:\> Update-AzBareMetal -Name oraclerac53 -ResourceGroupName SAT09A-T530 -Tag @{"env"="test"}
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+southcentralus oraclerac53 SAT09A-T530
+.Example
+PS C:\> Get-AzBareMetal -Name oraclerac53 -ResourceGroupName SAT09A-T530 | Update-AzBareMetal -Tag @{"env"="test"}
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+southcentralus oraclerac53 SAT09A-T530
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [AzureBareMetalInstanceName ]: Name of the Azure BareMetal on Azure instance.
+ [Id ]: Resource identity path
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.baremetal/update-azbaremetal
+#>
+function Update-AzBareMetal {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('AzureBareMetalInstanceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [System.String]
+ # Name of the Azure BareMetal on Azure instance.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags]))]
+ [System.Collections.Hashtable]
+ # Tags field of the AzureBareMetal instance.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ UpdateExpanded = 'Az.BareMetal.private\Update-AzBareMetal_UpdateExpanded';
+ UpdateViaIdentityExpanded = 'Az.BareMetal.private\Update-AzBareMetal_UpdateViaIdentityExpanded';
+ }
+ if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/BareMetal/exports/README.md b/src/BareMetal/exports/README.md
new file mode 100644
index 000000000000..bb724a28c34a
--- /dev/null
+++ b/src/BareMetal/exports/README.md
@@ -0,0 +1,20 @@
+# Exports
+This directory contains the cmdlets *exported by* `Az.BareMetal`. No other cmdlets in this repository are directly exported. What that means is the `Az.BareMetal` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation.
+
+## Info
+- Modifiable: no
+- Generated: all
+- Committed: no
+- Packaged: yes
+
+## Details
+The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`..\bin\Az.BareMetal.private.dll`) and from the `..\custom\Az.BareMetal.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](..\internal/README.md) in the `..\internal` folder.
+
+## Purpose
+We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles.
+
+## Structure
+The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile.
+
+## Usage
+When `./Az.BareMetal.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message.
\ No newline at end of file
diff --git a/src/BareMetal/exports/Update-AzBareMetal.ps1 b/src/BareMetal/exports/Update-AzBareMetal.ps1
new file mode 100644
index 000000000000..12813be21772
--- /dev/null
+++ b/src/BareMetal/exports/Update-AzBareMetal.ps1
@@ -0,0 +1,179 @@
+
+# ----------------------------------------------------------------------------------
+# 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,
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
+.Description
+Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
+.Example
+PS C:\> Update-AzBareMetal -Name oraclerac53 -ResourceGroupName SAT09A-T530 -Tag @{"env"="test"}
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+southcentralus oraclerac53 SAT09A-T530
+.Example
+PS C:\> Get-AzBareMetal -Name oraclerac53 -ResourceGroupName SAT09A-T530 | Update-AzBareMetal -Tag @{"env"="test"}
+
+Location Name ResourceGroupName
+-------- ---- -----------------
+southcentralus oraclerac53 SAT09A-T530
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [AzureBareMetalInstanceName ]: Name of the Azure BareMetal on Azure instance.
+ [Id ]: Resource identity path
+ [ResourceGroupName ]: The name of the resource group. The name is case insensitive.
+ [SubscriptionId ]: The ID of the target subscription.
+.Link
+https://docs.microsoft.com/powershell/module/az.baremetal/update-azbaremetal
+#>
+function Update-AzBareMetal {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('AzureBareMetalInstanceName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [System.String]
+ # Name of the Azure BareMetal on Azure instance.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [System.String]
+ # The name of the resource group.
+ # The name is case insensitive.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # The ID of the target subscription.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags]))]
+ [System.Collections.Hashtable]
+ # Tags field of the AzureBareMetal instance.
+ ${Tag},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+ $mapping = @{
+ UpdateExpanded = 'Az.BareMetal.private\Update-AzBareMetal_UpdateExpanded';
+ UpdateViaIdentityExpanded = 'Az.BareMetal.private\Update-AzBareMetal_UpdateViaIdentityExpanded';
+ }
+ if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ throw
+ }
+}
+
+end {
+ try {
+ $steppablePipeline.End()
+ } catch {
+ throw
+ }
+}
+}
diff --git a/src/BareMetal/generate-help.ps1 b/src/BareMetal/generate-help.ps1
new file mode 100644
index 000000000000..7ca55e16a722
--- /dev/null
+++ b/src/BareMetal/generate-help.ps1
@@ -0,0 +1,74 @@
+# ----------------------------------------------------------------------------------
+# 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,
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(-not (Test-Path $exportsFolder)) {
+ Write-Error "Exports folder '$exportsFolder' was not found."
+}
+
+$directories = Get-ChildItem -Directory -Path $exportsFolder
+$hasProfiles = ($directories | Measure-Object).Count -gt 0
+if(-not $hasProfiles) {
+ $directories = Get-Item -Path $exportsFolder
+}
+
+$docsFolder = Join-Path $PSScriptRoot 'docs'
+if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+
+$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.BareMetal.psd1')
+$modulePath = $modulePsd1.FullName
+$moduleName = $modulePsd1.BaseName
+
+# Load DLL to use build-time cmdlets
+Import-Module -Name $modulePath
+Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.BareMetal.private.dll')
+$instance = [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module]::Instance
+# Module info is shared per profile
+$moduleInfo = Get-Module -Name $moduleName
+
+foreach($directory in $directories)
+{
+ if($hasProfiles) {
+ Select-AzProfile -Name $directory.Name
+ }
+ # Reload module per profile
+ Import-Module -Name $modulePath -Force
+
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName
+ $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full }
+ $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo
+
+ $docsPath = Join-Path $docsFolder $directory.Name
+ $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue
+ $examplesPath = Join-Path $examplesFolder $directory.Name
+
+ Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath
+ Write-Host -ForegroundColor Green "Created documentation in '$docsPath'"
+}
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/BareMetal/generate-info.json b/src/BareMetal/generate-info.json
new file mode 100644
index 000000000000..93eded5c9331
--- /dev/null
+++ b/src/BareMetal/generate-info.json
@@ -0,0 +1,8 @@
+{
+ "swagger_commit": "7c1fa28900801ee179de9b287951b30befd805a2",
+ "autorest_core": "3.7.6",
+ "autorest_modelerfour": "4.15.414",
+ "autorest": "`-- (empty)",
+ "autorest_powershell": "3.0.477",
+ "node": "v14.15.5"
+}
diff --git a/src/BareMetal/generated/Module.cs b/src/BareMetal/generated/Module.cs
new file mode 100644
index 000000000000..fc45d225e9f1
--- /dev/null
+++ b/src/BareMetal/generated/Module.cs
@@ -0,0 +1,173 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+ using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+ using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>;
+ using GetParameterDelegate = global::System.Func;
+ using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using ArgumentCompleterDelegate = global::System.Func;
+ using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>;
+ using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>;
+ using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+
+ /// A class that contains the module-common code and data.
+ public partial class Module
+ {
+ /// The currently selected profile.
+ public string Profile = global::System.String.Empty;
+
+ public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler();
+
+ /// the ISendAsync pipeline instance
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline _pipeline;
+
+ /// the ISendAsync pipeline instance (when proxy is enabled)
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline _pipelineWithProxy;
+
+ public bool _useProxy = false;
+
+ public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy();
+
+ /// Gets completion data for azure specific fields
+ public ArgumentCompleterDelegate ArgumentCompleter { get; set; }
+
+ /// The instance of the Client API
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.BareMetal ClientAPI { get; set; }
+
+ /// A delegate that gets called for each signalled event
+ public EventListenerDelegate EventListener { get; set; }
+
+ /// The delegate to call to get parameter data from a common module.
+ public GetParameterDelegate GetParameterValue { get; set; }
+
+ /// Backing field for property.
+ private static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module _instance;
+
+ /// the singleton of this module class
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module());
+
+ /// The Name of this module
+ public string Name => @"Az.BareMetal";
+
+ /// The delegate to call when this module is loaded (supporting a commmon module).
+ public ModuleLoadPipelineDelegate OnModuleLoad { get; set; }
+
+ /// The delegate to call before each new request (supporting a commmon module).
+ public NewRequestPipelineDelegate OnNewRequest { get; set; }
+
+ /// The name of the currently selected Azure profile
+ public global::System.String ProfileName { get; set; }
+
+ /// The ResourceID for this module (azure arm).
+ public string ResourceId => @"Az.BareMetal";
+
+ /// The from the cmdlet
+ /// The HttpPipeline for the request
+
+ partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline pipeline);
+
+ /// The from the cmdlet
+ /// The HttpPipeline for the request
+
+ partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline pipeline);
+
+ partial void CustomInit();
+
+ /// Creates an instance of the HttpPipeline for each call.
+ /// The from the cmdlet
+ /// the cmdlet's correlation id.
+ /// the cmdlet's process record correlation id.
+ /// the cmdlet's parameterset name.
+ /// a dict for extensible parameters
+ /// An instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline for the remote call.
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline pipeline = null;
+ BeforeCreatePipeline(invocationInfo, ref pipeline);
+ pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone();
+ AfterCreatePipeline(invocationInfo, ref pipeline);
+ pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync);
+ OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } );
+ return pipeline;
+ }
+
+ /// Gets parameters from a common module.
+ /// The from the cmdlet
+ /// the cmdlet's correlation id.
+ /// The name of the parameter to get the value for.
+ ///
+ /// The parameter value from the common module. (Note: this should be type converted on the way back)
+ ///
+ public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName );
+
+ /// Initialization steps performed after the module is loaded.
+ public void Init()
+ {
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
+ CustomInit();
+ }
+
+ /// Creates the module instance.
+ private Module()
+ {
+ /// constructor
+ ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.BareMetal();
+ _handler.Proxy = _webProxy;
+ _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient()));
+ _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler)));
+ }
+
+ /// The HTTP Proxy to use.
+ /// The HTTP Proxy Credentials
+ /// True if the proxy should use default credentials
+ public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials)
+ {
+ _useProxy = proxy != null;
+ if (proxy == null)
+ {
+ return;
+ }
+ // set the proxy configuration
+ _webProxy.Address = proxy;
+ _webProxy.BypassProxyOnLocal = false;
+ if (proxyUseDefaultCredentials)
+ {
+ _webProxy.Credentials = null;
+ _webProxy.UseDefaultCredentials = true;
+ }
+ else
+ {
+ _webProxy.UseDefaultCredentials = false;
+ _webProxy.Credentials = proxyCredential ?.GetNetworkCredential();
+ }
+ }
+
+ /// Called to dispatch events to the common module listener
+ /// The ID of the event
+ /// The cancellation token for the event
+ /// A delegate to get the detailed event data
+ /// The callback for the event dispatcher
+ /// The from the cmdlet
+ /// the cmdlet's parameterset name.
+ /// the cmdlet's correlation id.
+ /// the cmdlet's process record correlation id.
+ /// the exception that is being thrown (if available)
+ ///
+ /// A that will be complete when handling of the event is completed.
+ ///
+ public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception)
+ {
+ using( NoSynchronizationContext )
+ {
+ await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/BareMetal.cs b/src/BareMetal/generated/api/BareMetal.cs
new file mode 100644
index 000000000000..649c82d2837a
--- /dev/null
+++ b/src/BareMetal/generated/api/BareMetal.cs
@@ -0,0 +1,853 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ ///
+ /// Low-level API implementation for the BareMetal service.
+ /// The BareMetalInfrastructure Management client
+ ///
+ public partial class BareMetal
+ {
+
+ ///
+ /// Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
+ ///
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of the Azure BareMetal on Azure instance.
+ /// a delegate that is called 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.BareMetal.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 AzureBareMetalInstancesGet(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-08-09";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/"
+ + global::System.Uri.EscapeDataString(azureBareMetalInstanceName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.AzureBareMetalInstancesGet_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
+ ///
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesGetViaIdentity(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-08-09";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var azureBareMetalInstanceName = _match.Groups["azureBareMetalInstanceName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/"
+ + azureBareMetalInstanceName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.AzureBareMetalInstancesGet_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesGet_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of the Azure BareMetal on Azure instance.
+ /// 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 AzureBareMetalInstancesGet_Validate(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90);
+ await eventListener.AssertNotNull(nameof(azureBareMetalInstanceName),azureBareMetalInstanceName);
+ }
+ }
+
+ ///
+ /// Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various
+ /// properties of each Azure BareMetal instance.
+ ///
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// a delegate that is called 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.BareMetal.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 AzureBareMetalInstancesListByResourceGroup(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-08-09";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.AzureBareMetalInstancesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various
+ /// properties of each Azure BareMetal instance.
+ ///
+ ///
+ /// a delegate that is called 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.BareMetal.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 AzureBareMetalInstancesListByResourceGroupViaIdentity(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-08-09";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.AzureBareMetalInstancesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Actual wire call for method.
+ ///
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesListByResourceGroup_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// 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 AzureBareMetalInstancesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90);
+ }
+ }
+
+ ///
+ /// Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each
+ /// Azure BareMetal instance.
+ ///
+ /// The ID of the target subscription.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-08-09";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.AzureBareMetalInstancesListBySubscription_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each
+ /// Azure BareMetal instance.
+ ///
+ ///
+ /// a delegate that is called 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.BareMetal.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 AzureBareMetalInstancesListBySubscriptionViaIdentity(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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-08-09";
+ // 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.BareMetalInfrastructure/bareMetalInstances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances'");
+ }
+
+ // 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.BareMetalInfrastructure/bareMetalInstances"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.AzureBareMetalInstancesListBySubscription_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Actual wire call for method.
+ ///
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesListBySubscription_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancesListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 ID of the target subscription.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task AzureBareMetalInstancesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1);
+ }
+ }
+
+ ///
+ /// Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
+ ///
+ /// The ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of the Azure BareMetal on Azure instance.
+ /// Request body that only contains the new Tags field
+ /// a delegate that is called 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.BareMetal.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 AzureBareMetalInstancesUpdate(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-08-09";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/"
+ + global::System.Uri.EscapeDataString(azureBareMetalInstanceName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.AzureBareMetalInstancesUpdate_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
+ ///
+ ///
+ /// Request body that only contains the new Tags field
+ /// a delegate that is called 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.BareMetal.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 AzureBareMetalInstancesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-08-09";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var azureBareMetalInstanceName = _match.Groups["azureBareMetalInstanceName"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/"
+ + azureBareMetalInstanceName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.AzureBareMetalInstancesUpdate_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 AzureBareMetalInstancesUpdate_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.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 ID of the target subscription.
+ /// The name of the resource group. The name is case insensitive.
+ /// Name of the Azure BareMetal on Azure instance.
+ /// Request body that only contains the new Tags field
+ /// 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 AzureBareMetalInstancesUpdate_Validate(string subscriptionId, string resourceGroupName, string azureBareMetalInstanceName, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 body, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1);
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90);
+ await eventListener.AssertNotNull(nameof(azureBareMetalInstanceName),azureBareMetalInstanceName);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ /// Gets a list of AzureBareMetal management operations.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-08-09";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.BareMetalInfrastructure/operations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Gets a list of AzureBareMetal management operations.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2021-08-09";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.BareMetalInfrastructure/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.BareMetalInfrastructure/operations'");
+ }
+
+ // replace URI parameters with values from identity
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.BareMetalInfrastructure/operations"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/Resource.PowerShell.cs b/src/BareMetal/generated/api/Models/Api10/Resource.PowerShell.cs
new file mode 100644
index 000000000000..b7c65ba7be9a
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/Resource.PowerShell.cs
@@ -0,0 +1,180 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// Common fields that are returned in the response for all Azure Resource Manager resources
+ ///
+ [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))]
+ public partial class Resource
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new Resource(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new Resource(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal Resource(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString);
+ }
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString);
+ }
+ if (content.Contains("Type"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal Resource(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString);
+ }
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString);
+ }
+ if (content.Contains("Type"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// Common fields that are returned in the response for all Azure Resource Manager resources
+ [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))]
+ public partial interface IResource
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/Resource.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api10/Resource.TypeConverter.cs
new file mode 100644
index 000000000000..64c7adf318af
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/Resource.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class ResourceTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return Resource.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return Resource.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/Resource.cs b/src/BareMetal/generated/api/Models/Api10/Resource.cs
new file mode 100644
index 000000000000..bc831a72b326
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/Resource.cs
@@ -0,0 +1,108 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ ///
+ /// Common fields that are returned in the response for all Azure Resource Manager resources
+ ///
+ public partial class Resource :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal
+ {
+
+ /// Backing field for property.
+ private string _id;
+
+ ///
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Id { get => this._id; }
+
+ /// Internal Acessors for Id
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Id { get => this._id; set { {_id = value;} } }
+
+ /// Internal Acessors for Name
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Name { get => this._name; set { {_name = value;} } }
+
+ /// Internal Acessors for Type
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Type { get => this._type; set { {_type = value;} } }
+
+ /// Backing field for property.
+ private string _name;
+
+ /// The name of the resource
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Name { get => this._name; }
+
+ /// Backing field for property.
+ private string _type;
+
+ ///
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Type { get => this._type; }
+
+ /// Creates an new instance.
+ public Resource()
+ {
+
+ }
+ }
+ /// Common fields that are returned in the response for all Azure Resource Manager resources
+ public partial interface IResource :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ ///
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}",
+ SerializedName = @"id",
+ PossibleTypes = new [] { typeof(string) })]
+ string Id { get; }
+ /// The name of the resource
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The name of the resource",
+ SerializedName = @"name",
+ PossibleTypes = new [] { typeof(string) })]
+ string Name { get; }
+ ///
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""",
+ SerializedName = @"type",
+ PossibleTypes = new [] { typeof(string) })]
+ string Type { get; }
+
+ }
+ /// Common fields that are returned in the response for all Azure Resource Manager resources
+ internal partial interface IResourceInternal
+
+ {
+ ///
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ///
+ string Id { get; set; }
+ /// The name of the resource
+ string Name { get; set; }
+ ///
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ ///
+ string Type { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/Resource.json.cs b/src/BareMetal/generated/api/Models/Api10/Resource.json.cs
new file mode 100644
index 000000000000..f3acc7a1e92d
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/Resource.json.cs
@@ -0,0 +1,121 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ ///
+ /// Common fields that are returned in the response for all Azure Resource Manager resources
+ ///
+ public partial class Resource
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Resource(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;}
+ {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;}
+ {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add );
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/SystemData.PowerShell.cs b/src/BareMetal/generated/api/Models/Api10/SystemData.PowerShell.cs
new file mode 100644
index 000000000000..a2e6f0e1137c
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/SystemData.PowerShell.cs
@@ -0,0 +1,202 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Metadata pertaining to creation and last modification of the resource.
+ [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))]
+ public partial class SystemData
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new SystemData(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new SystemData(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal SystemData(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("CreatedBy"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString);
+ }
+ if (content.Contains("CreatedByType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom);
+ }
+ if (content.Contains("CreatedAt"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified));
+ }
+ if (content.Contains("LastModifiedBy"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString);
+ }
+ if (content.Contains("LastModifiedByType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom);
+ }
+ if (content.Contains("LastModifiedAt"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal SystemData(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("CreatedBy"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString);
+ }
+ if (content.Contains("CreatedByType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom);
+ }
+ if (content.Contains("CreatedAt"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified));
+ }
+ if (content.Contains("LastModifiedBy"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString);
+ }
+ if (content.Contains("LastModifiedByType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom);
+ }
+ if (content.Contains("LastModifiedAt"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// Metadata pertaining to creation and last modification of the resource.
+ [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))]
+ public partial interface ISystemData
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/SystemData.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api10/SystemData.TypeConverter.cs
new file mode 100644
index 000000000000..039d95cfb0bb
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/SystemData.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class SystemDataTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return SystemData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return SystemData.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return SystemData.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/SystemData.cs b/src/BareMetal/generated/api/Models/Api10/SystemData.cs
new file mode 100644
index 000000000000..3165343926ad
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/SystemData.cs
@@ -0,0 +1,136 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Metadata pertaining to creation and last modification of the resource.
+ public partial class SystemData :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal
+ {
+
+ /// Backing field for property.
+ private global::System.DateTime? _createdAt;
+
+ /// The timestamp of resource creation (UTC).
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public global::System.DateTime? CreatedAt { get => this._createdAt; set => this._createdAt = value; }
+
+ /// Backing field for property.
+ private string _createdBy;
+
+ /// The identity that created the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string CreatedBy { get => this._createdBy; set => this._createdBy = value; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? _createdByType;
+
+ /// The type of identity that created the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; }
+
+ /// Backing field for property.
+ private global::System.DateTime? _lastModifiedAt;
+
+ /// The timestamp of resource last modification (UTC)
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public global::System.DateTime? LastModifiedAt { get => this._lastModifiedAt; set => this._lastModifiedAt = value; }
+
+ /// Backing field for property.
+ private string _lastModifiedBy;
+
+ /// The identity that last modified the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? _lastModifiedByType;
+
+ /// The type of identity that last modified the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; }
+
+ /// Creates an new instance.
+ public SystemData()
+ {
+
+ }
+ }
+ /// Metadata pertaining to creation and last modification of the resource.
+ public partial interface ISystemData :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// The timestamp of resource creation (UTC).
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The timestamp of resource creation (UTC).",
+ SerializedName = @"createdAt",
+ PossibleTypes = new [] { typeof(global::System.DateTime) })]
+ global::System.DateTime? CreatedAt { get; set; }
+ /// The identity that created the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The identity that created the resource.",
+ SerializedName = @"createdBy",
+ PossibleTypes = new [] { typeof(string) })]
+ string CreatedBy { get; set; }
+ /// The type of identity that created the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The type of identity that created the resource.",
+ SerializedName = @"createdByType",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? CreatedByType { get; set; }
+ /// The timestamp of resource last modification (UTC)
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The timestamp of resource last modification (UTC)",
+ SerializedName = @"lastModifiedAt",
+ PossibleTypes = new [] { typeof(global::System.DateTime) })]
+ global::System.DateTime? LastModifiedAt { get; set; }
+ /// The identity that last modified the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The identity that last modified the resource.",
+ SerializedName = @"lastModifiedBy",
+ PossibleTypes = new [] { typeof(string) })]
+ string LastModifiedBy { get; set; }
+ /// The type of identity that last modified the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The type of identity that last modified the resource.",
+ SerializedName = @"lastModifiedByType",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? LastModifiedByType { get; set; }
+
+ }
+ /// Metadata pertaining to creation and last modification of the resource.
+ internal partial interface ISystemDataInternal
+
+ {
+ /// The timestamp of resource creation (UTC).
+ global::System.DateTime? CreatedAt { get; set; }
+ /// The identity that created the resource.
+ string CreatedBy { get; set; }
+ /// The type of identity that created the resource.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? 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.BareMetal.Support.CreatedByType? LastModifiedByType { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/SystemData.json.cs b/src/BareMetal/generated/api/Models/Api10/SystemData.json.cs
new file mode 100644
index 000000000000..cef9f8d3ab09
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/SystemData.json.cs
@@ -0,0 +1,116 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Metadata pertaining to creation and last modification of the resource.
+ public partial class SystemData
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new SystemData(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ 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;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add );
+ AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add );
+ AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt" ,container.Add );
+ AddIf( null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add );
+ AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add );
+ AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/TrackedResource.PowerShell.cs b/src/BareMetal/generated/api/Models/Api10/TrackedResource.PowerShell.cs
new file mode 100644
index 000000000000..77d6ac49e086
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/TrackedResource.PowerShell.cs
@@ -0,0 +1,196 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
+ ///
+ [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))]
+ public partial class TrackedResource
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new TrackedResource(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new TrackedResource(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal TrackedResource(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Tag"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Location"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString);
+ }
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString);
+ }
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString);
+ }
+ if (content.Contains("Type"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal TrackedResource(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Tag"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Location"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString);
+ }
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString);
+ }
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString);
+ }
+ if (content.Contains("Type"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+ }
+ /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
+ [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))]
+ public partial interface ITrackedResource
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/TrackedResource.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api10/TrackedResource.TypeConverter.cs
new file mode 100644
index 000000000000..1264abfc226f
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/TrackedResource.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class TrackedResourceTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return TrackedResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return TrackedResource.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return TrackedResource.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/TrackedResource.cs b/src/BareMetal/generated/api/Models/Api10/TrackedResource.cs
new file mode 100644
index 000000000000..18d7b58196dd
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/TrackedResource.cs
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ ///
+ /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
+ ///
+ public partial class TrackedResource :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IValidates
+ {
+ ///
+ /// Backing field for Inherited model
+ ///
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.Resource();
+
+ ///
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)]
+ public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Id; }
+
+ /// Backing field for property.
+ private string _location;
+
+ /// The geo-location where the resource lives
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Location { get => this._location; set => this._location = value; }
+
+ /// Internal Acessors for Id
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Id = value; }
+
+ /// Internal Acessors for Name
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Name = value; }
+
+ /// Internal Acessors for Type
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Type = value; }
+
+ /// The name of the resource
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)]
+ public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Name; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags _tag;
+
+ /// Resource tags.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTags()); set => this._tag = value; }
+
+ ///
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)]
+ public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__resource).Type; }
+
+ /// Creates an new instance.
+ public TrackedResource()
+ {
+
+ }
+
+ /// Validates that this object meets the validation criteria.
+ /// an instance that will receive validation
+ /// events.
+ ///
+ /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed.
+ ///
+ public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener)
+ {
+ await eventListener.AssertNotNull(nameof(__resource), __resource);
+ await eventListener.AssertObjectIsValid(nameof(__resource), __resource);
+ }
+ }
+ /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
+ public partial interface ITrackedResource :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResource
+ {
+ /// The geo-location where the resource lives
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The geo-location where the resource lives",
+ SerializedName = @"location",
+ PossibleTypes = new [] { typeof(string) })]
+ string Location { get; set; }
+ /// Resource tags.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Resource tags.",
+ SerializedName = @"tags",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags Tag { get; set; }
+
+ }
+ /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
+ internal partial interface ITrackedResourceInternal :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal
+ {
+ /// The geo-location where the resource lives
+ string Location { get; set; }
+ /// Resource tags.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags Tag { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/TrackedResource.json.cs b/src/BareMetal/generated/api/Models/Api10/TrackedResource.json.cs
new file mode 100644
index 000000000000..79980d346ec7
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/TrackedResource.json.cs
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ ///
+ /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
+ ///
+ public partial class TrackedResource
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new TrackedResource(json) : null;
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ __resource?.ToJson(container, serializationMode);
+ AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add );
+ AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ __resource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.Resource(json);
+ {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTags.FromJson(__jsonTags) : Tag;}
+ {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;}
+ AfterFromJson(json);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs b/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs
new file mode 100644
index 000000000000..08b4225c966c
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs
@@ -0,0 +1,158 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Resource tags.
+ [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))]
+ public partial class TrackedResourceTags
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new TrackedResourceTags(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new TrackedResourceTags(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal TrackedResourceTags(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ // this type is a dictionary; copy elements from source to here.
+ CopyFrom(content);
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal TrackedResourceTags(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ // this type is a dictionary; copy elements from source to here.
+ CopyFrom(content);
+ AfterDeserializePSObject(content);
+ }
+ }
+ /// Resource tags.
+ [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))]
+ public partial interface ITrackedResourceTags
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs
new file mode 100644
index 000000000000..06542a71cd5f
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return TrackedResourceTags.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return TrackedResourceTags.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.cs b/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.cs
new file mode 100644
index 000000000000..967d3f92dc7a
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Resource tags.
+ public partial class TrackedResourceTags :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTagsInternal
+ {
+
+ /// Creates an new instance.
+ public TrackedResourceTags()
+ {
+
+ }
+ }
+ /// Resource tags.
+ public partial interface ITrackedResourceTags :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray
+ {
+
+ }
+ /// Resource tags.
+ internal partial interface ITrackedResourceTagsInternal
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs b/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs
new file mode 100644
index 000000000000..46e822af2ba8
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ public partial class TrackedResourceTags :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray
+ {
+ protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary();
+
+ global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; }
+
+ int Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; }
+
+ global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; }
+
+ global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; }
+
+ public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; }
+
+ ///
+ ///
+ public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value);
+
+ public void Clear() => __additionalProperties.Clear();
+
+ ///
+ public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key);
+
+ ///
+ public void CopyFrom(global::System.Collections.IDictionary source)
+ {
+ if (null != source)
+ {
+ foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) )
+ {
+ if ((null != property.Key && null != property.Value))
+ {
+ this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value));
+ }
+ }
+ }
+ }
+
+ ///
+ public void CopyFrom(global::System.Management.Automation.PSObject source)
+ {
+ if (null != source)
+ {
+ foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) )
+ {
+ if ((null != property.Key && null != property.Value))
+ {
+ this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value));
+ }
+ }
+ }
+ }
+
+ ///
+ public bool Remove(global::System.String key) => __additionalProperties.Remove( key);
+
+ ///
+ ///
+ public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value);
+
+ ///
+
+ public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTags source) => source.__additionalProperties;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.json.cs b/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.json.cs
new file mode 100644
index 000000000000..5dcb54c9672a
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api10/TrackedResourceTags.json.cs
@@ -0,0 +1,107 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Resource tags.
+ public partial class TrackedResourceTags
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null;
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray)this).AdditionalProperties, container);
+ AfterToJson(ref container);
+ return container;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ ///
+ internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions );
+ AfterFromJson(json);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.PowerShell.cs
new file mode 100644
index 000000000000..06081521e4c0
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.PowerShell.cs
@@ -0,0 +1,420 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties)
+ ///
+ [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstanceTypeConverter))]
+ public partial class AzureBareMetalInstance
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of 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 AzureBareMetalInstance(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.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancePropertiesTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("SystemData"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemDataTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString);
+ }
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString);
+ }
+ if (content.Contains("Type"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString);
+ }
+ if (content.Contains("Tag"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Location"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString);
+ }
+ if (content.Contains("HardwareProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("StorageProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("OSProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("NetworkProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("SystemDataCreatedBy"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString);
+ }
+ if (content.Contains("SystemDataCreatedAt"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)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("AzureBareMetalInstanceId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString);
+ }
+ if (content.Contains("PowerState"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum.CreateFrom);
+ }
+ if (content.Contains("ProximityPlacementGroup"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup, global::System.Convert.ToString);
+ }
+ if (content.Contains("HwRevision"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HwRevision, global::System.Convert.ToString);
+ }
+ if (content.Contains("PartnerNodeId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PartnerNodeId, global::System.Convert.ToString);
+ }
+ if (content.Contains("ProvisioningState"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum.CreateFrom);
+ }
+ if (content.Contains("StorageProfileOSDisk"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NetworkProfileNetworkInterface"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NetworkProfileCircuitId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString);
+ }
+ if (content.Contains("SystemDataCreatedByType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom);
+ }
+ if (content.Contains("SystemDataLastModifiedBy"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString);
+ }
+ if (content.Contains("SystemDataLastModifiedByType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom);
+ }
+ if (content.Contains("SystemDataLastModifiedAt"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified));
+ }
+ if (content.Contains("HardwareProfileHardwareType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom);
+ }
+ if (content.Contains("HardwareProfileAzureBareMetalInstanceSize"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom);
+ }
+ if (content.Contains("StorageProfileNfsIPAddress"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileComputerName"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileComputerName, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileOstype"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileOstype, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileVersion"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileVersion, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileSshPublicKey"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal AzureBareMetalInstance(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.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstancePropertiesTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("SystemData"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemDataTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString);
+ }
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString);
+ }
+ if (content.Contains("Type"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString);
+ }
+ if (content.Contains("Tag"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Location"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString);
+ }
+ if (content.Contains("HardwareProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("StorageProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("OSProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("NetworkProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("SystemDataCreatedBy"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString);
+ }
+ if (content.Contains("SystemDataCreatedAt"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)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("AzureBareMetalInstanceId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString);
+ }
+ if (content.Contains("PowerState"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum.CreateFrom);
+ }
+ if (content.Contains("ProximityPlacementGroup"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProximityPlacementGroup, global::System.Convert.ToString);
+ }
+ if (content.Contains("HwRevision"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HwRevision, global::System.Convert.ToString);
+ }
+ if (content.Contains("PartnerNodeId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).PartnerNodeId, global::System.Convert.ToString);
+ }
+ if (content.Contains("ProvisioningState"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum.CreateFrom);
+ }
+ if (content.Contains("StorageProfileOSDisk"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NetworkProfileNetworkInterface"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NetworkProfileCircuitId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString);
+ }
+ if (content.Contains("SystemDataCreatedByType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom);
+ }
+ if (content.Contains("SystemDataLastModifiedBy"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString);
+ }
+ if (content.Contains("SystemDataLastModifiedByType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType.CreateFrom);
+ }
+ if (content.Contains("SystemDataLastModifiedAt"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified));
+ }
+ if (content.Contains("HardwareProfileHardwareType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileHardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom);
+ }
+ if (content.Contains("HardwareProfileAzureBareMetalInstanceSize"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).HardwareProfileAzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom);
+ }
+ if (content.Contains("StorageProfileNfsIPAddress"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileComputerName"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileComputerName, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileOstype"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileOstype, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileVersion"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileVersion, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileSshPublicKey"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal)this).OSProfileSshPublicKey, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new AzureBareMetalInstance(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new AzureBareMetalInstance(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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();
+ }
+ }
+ /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties)
+ [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstanceTypeConverter))]
+ public partial interface IAzureBareMetalInstance
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.TypeConverter.cs
new file mode 100644
index 000000000000..4fea6889c028
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class AzureBareMetalInstanceTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return AzureBareMetalInstance.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return AzureBareMetalInstance.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return AzureBareMetalInstance.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.cs
new file mode 100644
index 000000000000..839bf2c2c697
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.cs
@@ -0,0 +1,489 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ ///
+ /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties)
+ ///
+ public partial class AzureBareMetalInstance :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IValidates
+ {
+ ///
+ /// Backing field for Inherited model
+ ///
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResource();
+
+ /// Specifies the AzureBareMetal instance unique ID.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string AzureBareMetalInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).AzureBareMetalInstanceId; }
+
+ /// Specifies the AzureBareMetal instance SKU.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileAzureBareMetalInstanceSize; }
+
+ /// Name of the hardware type (vendor and/or their product name)
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileHardwareType; }
+
+ /// Hardware revision of an AzureBareMetal instance
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string HwRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HwRevision; }
+
+ ///
+ /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)]
+ public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Id; }
+
+ /// The geo-location where the resource lives
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)]
+ public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)__trackedResource).Location = value ; }
+
+ /// Internal Acessors for Id
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Id = value; }
+
+ /// Internal Acessors for Name
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Name = value; }
+
+ /// Internal Acessors for Type
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Type = value; }
+
+ /// Internal Acessors for AzureBareMetalInstanceId
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.AzureBareMetalInstanceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).AzureBareMetalInstanceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).AzureBareMetalInstanceId = value; }
+
+ /// Internal Acessors for HardwareProfile
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.HardwareProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfile = value; }
+
+ /// Internal Acessors for HardwareProfileAzureBareMetalInstanceSize
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileAzureBareMetalInstanceSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileAzureBareMetalInstanceSize = value; }
+
+ /// Internal Acessors for HardwareProfileHardwareType
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileHardwareType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HardwareProfileHardwareType = value; }
+
+ /// Internal Acessors for HwRevision
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.HwRevision { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HwRevision; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).HwRevision = value; }
+
+ /// Internal Acessors for NetworkProfile
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.NetworkProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfile = value; }
+
+ /// Internal Acessors for NetworkProfileCircuitId
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileCircuitId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileCircuitId = value; }
+
+ /// Internal Acessors for OSProfile
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.OSProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfile = value; }
+
+ /// Internal Acessors for OSProfileOstype
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileOstype; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileOstype = value; }
+
+ /// Internal Acessors for OSProfileVersion
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileVersion = value; }
+
+ /// Internal Acessors for PowerState
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).PowerState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).PowerState = value; }
+
+ /// Internal Acessors for Property
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceProperties()); set { {_property = value;} } }
+
+ /// Internal Acessors for ProvisioningState
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProvisioningState = value; }
+
+ /// Internal Acessors for ProximityPlacementGroup
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.ProximityPlacementGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProximityPlacementGroup; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProximityPlacementGroup = value; }
+
+ /// Internal Acessors for StorageProfile
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.StorageProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfile = value; }
+
+ /// Internal Acessors for StorageProfileNfsIPAddress
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileNfsIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileNfsIPAddress = value; }
+
+ /// Internal Acessors for SystemData
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemData()); set { {_systemData = value;} } }
+
+ /// The name of the resource
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)]
+ public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Name; }
+
+ /// Specifies the circuit id for connecting to express route.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileCircuitId; }
+
+ /// Specifies the network interfaces for the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileNetworkInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).NetworkProfileNetworkInterface = value ?? null /* arrayOf */; }
+
+ /// Specifies the host OS name of the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string OSProfileComputerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileComputerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileComputerName = value ?? null; }
+
+ /// This property allows you to specify the type of the OS.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileOstype; }
+
+ /// Specifies the SSH public key used to access the operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string OSProfileSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileSshPublicKey = value ?? null; }
+
+ /// Specifies version of operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).OSProfileVersion; }
+
+ ///
+ /// ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string PartnerNodeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).PartnerNodeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).PartnerNodeId = value ?? null; }
+
+ /// Resource power state
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).PowerState; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties _property;
+
+ /// AzureBareMetal instance properties
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceProperties()); set => this._property = value; }
+
+ /// State of provisioning of the AzureBareMetalInstance
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProvisioningState; }
+
+ /// Resource proximity placement group
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string ProximityPlacementGroup { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).ProximityPlacementGroup; }
+
+ /// Gets the resource group name
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); }
+
+ /// IP Address to connect to storage.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileNfsIPAddress; }
+
+ ///
+ /// Specifies information about the operating system disk used by baremetal instance.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileOSDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)Property).StorageProfileOSDisk = value ?? null /* arrayOf */; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData _systemData;
+
+ /// The system metadata relating to this resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemData()); }
+
+ /// The timestamp of resource creation (UTC).
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); }
+
+ /// The identity that created the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedBy = value ?? null; }
+
+ /// The type of identity that created the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType)""); }
+
+ /// The timestamp of resource last modification (UTC)
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); }
+
+ /// The identity that last modified the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; }
+
+ /// The type of identity that last modified the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType)""); }
+
+ /// Resource tags.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; }
+
+ ///
+ /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inherited)]
+ public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.IResourceInternal)__trackedResource).Type; }
+
+ /// Creates an new instance.
+ public AzureBareMetalInstance()
+ {
+
+ }
+
+ /// Validates that this object meets the validation criteria.
+ /// an instance that will receive validation
+ /// events.
+ ///
+ /// A < see cref = "global::System.Threading.Tasks.Task" /> that will be complete when validation is completed.
+ ///
+ public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener eventListener)
+ {
+ await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource);
+ await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource);
+ }
+ }
+ /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties)
+ public partial interface IAzureBareMetalInstance :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResource
+ {
+ /// Specifies the AzureBareMetal instance unique ID.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies the AzureBareMetal instance unique ID.",
+ SerializedName = @"azureBareMetalInstanceId",
+ PossibleTypes = new [] { typeof(string) })]
+ string AzureBareMetalInstanceId { get; }
+ /// Specifies the AzureBareMetal instance SKU.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies the AzureBareMetal instance SKU.",
+ SerializedName = @"azureBareMetalInstanceSize",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get; }
+ /// Name of the hardware type (vendor and/or their product name)
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Name of the hardware type (vendor and/or their product name)",
+ SerializedName = @"hardwareType",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get; }
+ /// Hardware revision of an AzureBareMetal instance
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Hardware revision of an AzureBareMetal instance",
+ SerializedName = @"hwRevision",
+ PossibleTypes = new [] { typeof(string) })]
+ string HwRevision { get; }
+ /// Specifies the circuit id for connecting to express route.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies the circuit id for connecting to express route.",
+ SerializedName = @"circuitId",
+ PossibleTypes = new [] { typeof(string) })]
+ string NetworkProfileCircuitId { get; }
+ /// Specifies the network interfaces for the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the network interfaces for the AzureBareMetal instance.",
+ SerializedName = @"networkInterfaces",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get; set; }
+ /// Specifies the host OS name of the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the host OS name of the AzureBareMetal instance.",
+ SerializedName = @"computerName",
+ PossibleTypes = new [] { typeof(string) })]
+ string OSProfileComputerName { get; set; }
+ /// This property allows you to specify the type of the OS.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"This property allows you to specify the type of the OS.",
+ SerializedName = @"osType",
+ PossibleTypes = new [] { typeof(string) })]
+ string OSProfileOstype { get; }
+ /// Specifies the SSH public key used to access the operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the SSH public key used to access the operating system.",
+ SerializedName = @"sshPublicKey",
+ PossibleTypes = new [] { typeof(string) })]
+ string OSProfileSshPublicKey { get; set; }
+ /// Specifies version of operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies version of operating system.",
+ SerializedName = @"version",
+ PossibleTypes = new [] { typeof(string) })]
+ string OSProfileVersion { get; }
+ ///
+ /// ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance",
+ SerializedName = @"partnerNodeId",
+ PossibleTypes = new [] { typeof(string) })]
+ string PartnerNodeId { get; set; }
+ /// Resource power state
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Resource power state",
+ SerializedName = @"powerState",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get; }
+ /// State of provisioning of the AzureBareMetalInstance
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"State of provisioning of the AzureBareMetalInstance",
+ SerializedName = @"provisioningState",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get; }
+ /// Resource proximity placement group
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Resource proximity placement group",
+ SerializedName = @"proximityPlacementGroup",
+ PossibleTypes = new [] { typeof(string) })]
+ string ProximityPlacementGroup { get; }
+ /// IP Address to connect to storage.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"IP Address to connect to storage.",
+ SerializedName = @"nfsIpAddress",
+ PossibleTypes = new [] { typeof(string) })]
+ string StorageProfileNfsIPAddress { get; }
+ ///
+ /// Specifies information about the operating system disk used by baremetal instance.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies information about the operating system disk used by baremetal instance.",
+ SerializedName = @"osDisks",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get; set; }
+ /// The timestamp of resource creation (UTC).
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The timestamp of resource creation (UTC).",
+ SerializedName = @"createdAt",
+ PossibleTypes = new [] { typeof(global::System.DateTime) })]
+ global::System.DateTime? SystemDataCreatedAt { get; set; }
+ /// The identity that created the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The identity that created the resource.",
+ SerializedName = @"createdBy",
+ PossibleTypes = new [] { typeof(string) })]
+ string SystemDataCreatedBy { get; set; }
+ /// The type of identity that created the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The type of identity that created the resource.",
+ SerializedName = @"createdByType",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? SystemDataCreatedByType { get; set; }
+ /// The timestamp of resource last modification (UTC)
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The timestamp of resource last modification (UTC)",
+ SerializedName = @"lastModifiedAt",
+ PossibleTypes = new [] { typeof(global::System.DateTime) })]
+ global::System.DateTime? SystemDataLastModifiedAt { get; set; }
+ /// The identity that last modified the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The identity that last modified the resource.",
+ SerializedName = @"lastModifiedBy",
+ PossibleTypes = new [] { typeof(string) })]
+ string SystemDataLastModifiedBy { get; set; }
+ /// The type of identity that last modified the resource.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The type of identity that last modified the resource.",
+ SerializedName = @"lastModifiedByType",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType? SystemDataLastModifiedByType { get; set; }
+
+ }
+ /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties)
+ internal partial interface IAzureBareMetalInstanceInternal :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.ITrackedResourceInternal
+ {
+ /// Specifies the AzureBareMetal instance unique ID.
+ string AzureBareMetalInstanceId { get; set; }
+ /// Specifies the hardware settings for the AzureBareMetal instance.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile HardwareProfile { get; set; }
+ /// Specifies the AzureBareMetal instance SKU.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get; set; }
+ /// Name of the hardware type (vendor and/or their product name)
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get; set; }
+ /// Hardware revision of an AzureBareMetal instance
+ string HwRevision { get; set; }
+ /// Specifies the network settings for the AzureBareMetal instance.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile NetworkProfile { get; set; }
+ /// Specifies the circuit id for connecting to express route.
+ string NetworkProfileCircuitId { get; set; }
+ /// Specifies the network interfaces for the AzureBareMetal instance.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get; set; }
+ /// Specifies the operating system settings for the AzureBareMetal instance.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile OSProfile { get; set; }
+ /// Specifies the host OS name of the AzureBareMetal instance.
+ string OSProfileComputerName { get; set; }
+ /// This property allows you to specify the type of the OS.
+ string OSProfileOstype { get; set; }
+ /// Specifies the SSH public key used to access the operating system.
+ string OSProfileSshPublicKey { get; set; }
+ /// Specifies version of operating system.
+ string OSProfileVersion { get; set; }
+ ///
+ /// ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance
+ ///
+ string PartnerNodeId { get; set; }
+ /// Resource power state
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get; set; }
+ /// AzureBareMetal instance properties
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties Property { get; set; }
+ /// State of provisioning of the AzureBareMetalInstance
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get; set; }
+ /// Resource proximity placement group
+ string ProximityPlacementGroup { get; set; }
+ /// Specifies the storage settings for the AzureBareMetal instance disks.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile StorageProfile { get; set; }
+ /// IP Address to connect to storage.
+ string StorageProfileNfsIPAddress { get; set; }
+ ///
+ /// Specifies information about the operating system disk used by baremetal instance.
+ ///
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get; set; }
+ /// The system metadata relating to this resource.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.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.BareMetal.Support.CreatedByType? 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.BareMetal.Support.CreatedByType? SystemDataLastModifiedByType { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.json.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.json.cs
new file mode 100644
index 000000000000..53ee1d61a256
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstance.json.cs
@@ -0,0 +1,115 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ ///
+ /// AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties)
+ ///
+ public partial class AzureBareMetalInstance
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal AzureBareMetalInstance(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.TrackedResource(json);
+ {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceProperties.FromJson(__jsonProperties) : Property;}
+ {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api10.SystemData.FromJson(__jsonSystemData) : SystemData;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new AzureBareMetalInstance(json) : null;
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ __trackedResource?.ToJson(container, serializationMode);
+ AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add );
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add );
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.PowerShell.cs
new file mode 100644
index 000000000000..c23bd4966b35
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.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.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Describes the properties of an AzureBareMetal instance.
+ [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstancePropertiesTypeConverter))]
+ public partial class AzureBareMetalInstanceProperties
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of 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 AzureBareMetalInstanceProperties(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("HardwareProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("StorageProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("OSProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("NetworkProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("AzureBareMetalInstanceId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString);
+ }
+ if (content.Contains("PowerState"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum.CreateFrom);
+ }
+ if (content.Contains("ProximityPlacementGroup"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup, global::System.Convert.ToString);
+ }
+ if (content.Contains("HwRevision"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HwRevision, global::System.Convert.ToString);
+ }
+ if (content.Contains("PartnerNodeId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId, global::System.Convert.ToString);
+ }
+ if (content.Contains("ProvisioningState"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum.CreateFrom);
+ }
+ if (content.Contains("StorageProfileOSDisk"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NetworkProfileNetworkInterface"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NetworkProfileCircuitId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString);
+ }
+ if (content.Contains("HardwareProfileHardwareType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom);
+ }
+ if (content.Contains("HardwareProfileAzureBareMetalInstanceSize"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom);
+ }
+ if (content.Contains("StorageProfileNfsIPAddress"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileComputerName"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileOstype"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileVersion"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileSshPublicKey"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal AzureBareMetalInstanceProperties(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("HardwareProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile) content.GetValueForProperty("HardwareProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("StorageProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("OSProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile) content.GetValueForProperty("OSProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("NetworkProfile"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile) content.GetValueForProperty("NetworkProfile",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfile, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfileTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("AzureBareMetalInstanceId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId = (string) content.GetValueForProperty("AzureBareMetalInstanceId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).AzureBareMetalInstanceId, global::System.Convert.ToString);
+ }
+ if (content.Contains("PowerState"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum.CreateFrom);
+ }
+ if (content.Contains("ProximityPlacementGroup"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup = (string) content.GetValueForProperty("ProximityPlacementGroup",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProximityPlacementGroup, global::System.Convert.ToString);
+ }
+ if (content.Contains("HwRevision"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HwRevision = (string) content.GetValueForProperty("HwRevision",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HwRevision, global::System.Convert.ToString);
+ }
+ if (content.Contains("PartnerNodeId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId = (string) content.GetValueForProperty("PartnerNodeId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).PartnerNodeId, global::System.Convert.ToString);
+ }
+ if (content.Contains("ProvisioningState"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum.CreateFrom);
+ }
+ if (content.Contains("StorageProfileOSDisk"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileOSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NetworkProfileNetworkInterface"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkProfileNetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileNetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NetworkProfileCircuitId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId = (string) content.GetValueForProperty("NetworkProfileCircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).NetworkProfileCircuitId, global::System.Convert.ToString);
+ }
+ if (content.Contains("HardwareProfileHardwareType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareProfileHardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileHardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom);
+ }
+ if (content.Contains("HardwareProfileAzureBareMetalInstanceSize"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("HardwareProfileAzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).HardwareProfileAzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom);
+ }
+ if (content.Contains("StorageProfileNfsIPAddress"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress = (string) content.GetValueForProperty("StorageProfileNfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).StorageProfileNfsIPAddress, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileComputerName"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName = (string) content.GetValueForProperty("OSProfileComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileComputerName, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileOstype"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype = (string) content.GetValueForProperty("OSProfileOstype",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileOstype, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileVersion"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion = (string) content.GetValueForProperty("OSProfileVersion",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileVersion, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSProfileSshPublicKey"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey = (string) content.GetValueForProperty("OSProfileSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal)this).OSProfileSshPublicKey, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new AzureBareMetalInstanceProperties(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new AzureBareMetalInstanceProperties(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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();
+ }
+ }
+ /// Describes the properties of an AzureBareMetal instance.
+ [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstancePropertiesTypeConverter))]
+ public partial interface IAzureBareMetalInstanceProperties
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.TypeConverter.cs
new file mode 100644
index 000000000000..f0c436de9cc1
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class AzureBareMetalInstancePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return AzureBareMetalInstanceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return AzureBareMetalInstanceProperties.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return AzureBareMetalInstanceProperties.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.cs
new file mode 100644
index 000000000000..dbf23aaba7f1
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.cs
@@ -0,0 +1,369 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Describes the properties of an AzureBareMetal instance.
+ public partial class AzureBareMetalInstanceProperties :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal
+ {
+
+ /// Backing field for property.
+ private string _azureBareMetalInstanceId;
+
+ /// Specifies the AzureBareMetal instance unique ID.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string AzureBareMetalInstanceId { get => this._azureBareMetalInstanceId; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile _hardwareProfile;
+
+ /// Specifies the hardware settings for the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile HardwareProfile { get => (this._hardwareProfile = this._hardwareProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfile()); set => this._hardwareProfile = value; }
+
+ /// Specifies the AzureBareMetal instance SKU.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).AzureBareMetalInstanceSize; }
+
+ /// Name of the hardware type (vendor and/or their product name)
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).HardwareType; }
+
+ /// Backing field for property.
+ private string _hwRevision;
+
+ /// Hardware revision of an AzureBareMetal instance
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string HwRevision { get => this._hwRevision; }
+
+ /// Internal Acessors for AzureBareMetalInstanceId
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.AzureBareMetalInstanceId { get => this._azureBareMetalInstanceId; set { {_azureBareMetalInstanceId = value;} } }
+
+ /// Internal Acessors for HardwareProfile
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.HardwareProfile { get => (this._hardwareProfile = this._hardwareProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfile()); set { {_hardwareProfile = value;} } }
+
+ /// Internal Acessors for HardwareProfileAzureBareMetalInstanceSize
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.HardwareProfileAzureBareMetalInstanceSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).AzureBareMetalInstanceSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).AzureBareMetalInstanceSize = value; }
+
+ /// Internal Acessors for HardwareProfileHardwareType
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.HardwareProfileHardwareType { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).HardwareType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)HardwareProfile).HardwareType = value; }
+
+ /// Internal Acessors for HwRevision
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.HwRevision { get => this._hwRevision; set { {_hwRevision = value;} } }
+
+ /// Internal Acessors for NetworkProfile
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfile()); set { {_networkProfile = value;} } }
+
+ /// Internal Acessors for NetworkProfileCircuitId
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)NetworkProfile).CircuitId; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)NetworkProfile).CircuitId = value; }
+
+ /// Internal Acessors for OSProfile
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.OSProfile { get => (this._oSProfile = this._oSProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfile()); set { {_oSProfile = value;} } }
+
+ /// Internal Acessors for OSProfileOstype
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).OSType; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).OSType = value; }
+
+ /// Internal Acessors for OSProfileVersion
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).Version = value; }
+
+ /// Internal Acessors for PowerState
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.PowerState { get => this._powerState; set { {_powerState = value;} } }
+
+ /// Internal Acessors for ProvisioningState
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } }
+
+ /// Internal Acessors for ProximityPlacementGroup
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.ProximityPlacementGroup { get => this._proximityPlacementGroup; set { {_proximityPlacementGroup = value;} } }
+
+ /// Internal Acessors for StorageProfile
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfile()); set { {_storageProfile = value;} } }
+
+ /// Internal Acessors for StorageProfileNfsIPAddress
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancePropertiesInternal.StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)StorageProfile).NfsIPAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)StorageProfile).NfsIPAddress = value; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile _networkProfile;
+
+ /// Specifies the network settings for the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile NetworkProfile { get => (this._networkProfile = this._networkProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfile()); set => this._networkProfile = value; }
+
+ /// Specifies the circuit id for connecting to express route.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string NetworkProfileCircuitId { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)NetworkProfile).CircuitId; }
+
+ /// Specifies the network interfaces for the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)NetworkProfile).NetworkInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)NetworkProfile).NetworkInterface = value ?? null /* arrayOf */; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile _oSProfile;
+
+ /// Specifies the operating system settings for the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile OSProfile { get => (this._oSProfile = this._oSProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfile()); set => this._oSProfile = value; }
+
+ /// Specifies the host OS name of the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string OSProfileComputerName { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).ComputerName; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).ComputerName = value ?? null; }
+
+ /// This property allows you to specify the type of the OS.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string OSProfileOstype { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).OSType; }
+
+ /// Specifies the SSH public key used to access the operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string OSProfileSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).SshPublicKey = value ?? null; }
+
+ /// Specifies version of operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string OSProfileVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)OSProfile).Version; }
+
+ /// Backing field for property.
+ private string _partnerNodeId;
+
+ ///
+ /// ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string PartnerNodeId { get => this._partnerNodeId; set => this._partnerNodeId = value; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? _powerState;
+
+ /// Resource power state
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get => this._powerState; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? _provisioningState;
+
+ /// State of provisioning of the AzureBareMetalInstance
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get => this._provisioningState; }
+
+ /// Backing field for property.
+ private string _proximityPlacementGroup;
+
+ /// Resource proximity placement group
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string ProximityPlacementGroup { get => this._proximityPlacementGroup; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile _storageProfile;
+
+ /// Specifies the storage settings for the AzureBareMetal instance disks.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfile()); set => this._storageProfile = value; }
+
+ /// IP Address to connect to storage.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string StorageProfileNfsIPAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)StorageProfile).NfsIPAddress; }
+
+ ///
+ /// Specifies information about the operating system disk used by baremetal instance.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)StorageProfile).OSDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)StorageProfile).OSDisk = value ?? null /* arrayOf */; }
+
+ /// Creates an new instance.
+ public AzureBareMetalInstanceProperties()
+ {
+
+ }
+ }
+ /// Describes the properties of an AzureBareMetal instance.
+ public partial interface IAzureBareMetalInstanceProperties :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// Specifies the AzureBareMetal instance unique ID.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies the AzureBareMetal instance unique ID.",
+ SerializedName = @"azureBareMetalInstanceId",
+ PossibleTypes = new [] { typeof(string) })]
+ string AzureBareMetalInstanceId { get; }
+ /// Specifies the AzureBareMetal instance SKU.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies the AzureBareMetal instance SKU.",
+ SerializedName = @"azureBareMetalInstanceSize",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get; }
+ /// Name of the hardware type (vendor and/or their product name)
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Name of the hardware type (vendor and/or their product name)",
+ SerializedName = @"hardwareType",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get; }
+ /// Hardware revision of an AzureBareMetal instance
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Hardware revision of an AzureBareMetal instance",
+ SerializedName = @"hwRevision",
+ PossibleTypes = new [] { typeof(string) })]
+ string HwRevision { get; }
+ /// Specifies the circuit id for connecting to express route.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies the circuit id for connecting to express route.",
+ SerializedName = @"circuitId",
+ PossibleTypes = new [] { typeof(string) })]
+ string NetworkProfileCircuitId { get; }
+ /// Specifies the network interfaces for the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the network interfaces for the AzureBareMetal instance.",
+ SerializedName = @"networkInterfaces",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get; set; }
+ /// Specifies the host OS name of the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the host OS name of the AzureBareMetal instance.",
+ SerializedName = @"computerName",
+ PossibleTypes = new [] { typeof(string) })]
+ string OSProfileComputerName { get; set; }
+ /// This property allows you to specify the type of the OS.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"This property allows you to specify the type of the OS.",
+ SerializedName = @"osType",
+ PossibleTypes = new [] { typeof(string) })]
+ string OSProfileOstype { get; }
+ /// Specifies the SSH public key used to access the operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the SSH public key used to access the operating system.",
+ SerializedName = @"sshPublicKey",
+ PossibleTypes = new [] { typeof(string) })]
+ string OSProfileSshPublicKey { get; set; }
+ /// Specifies version of operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies version of operating system.",
+ SerializedName = @"version",
+ PossibleTypes = new [] { typeof(string) })]
+ string OSProfileVersion { get; }
+ ///
+ /// ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance",
+ SerializedName = @"partnerNodeId",
+ PossibleTypes = new [] { typeof(string) })]
+ string PartnerNodeId { get; set; }
+ /// Resource power state
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Resource power state",
+ SerializedName = @"powerState",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get; }
+ /// State of provisioning of the AzureBareMetalInstance
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"State of provisioning of the AzureBareMetalInstance",
+ SerializedName = @"provisioningState",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get; }
+ /// Resource proximity placement group
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Resource proximity placement group",
+ SerializedName = @"proximityPlacementGroup",
+ PossibleTypes = new [] { typeof(string) })]
+ string ProximityPlacementGroup { get; }
+ /// IP Address to connect to storage.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"IP Address to connect to storage.",
+ SerializedName = @"nfsIpAddress",
+ PossibleTypes = new [] { typeof(string) })]
+ string StorageProfileNfsIPAddress { get; }
+ ///
+ /// Specifies information about the operating system disk used by baremetal instance.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies information about the operating system disk used by baremetal instance.",
+ SerializedName = @"osDisks",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get; set; }
+
+ }
+ /// Describes the properties of an AzureBareMetal instance.
+ internal partial interface IAzureBareMetalInstancePropertiesInternal
+
+ {
+ /// Specifies the AzureBareMetal instance unique ID.
+ string AzureBareMetalInstanceId { get; set; }
+ /// Specifies the hardware settings for the AzureBareMetal instance.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile HardwareProfile { get; set; }
+ /// Specifies the AzureBareMetal instance SKU.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? HardwareProfileAzureBareMetalInstanceSize { get; set; }
+ /// Name of the hardware type (vendor and/or their product name)
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareProfileHardwareType { get; set; }
+ /// Hardware revision of an AzureBareMetal instance
+ string HwRevision { get; set; }
+ /// Specifies the network settings for the AzureBareMetal instance.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile NetworkProfile { get; set; }
+ /// Specifies the circuit id for connecting to express route.
+ string NetworkProfileCircuitId { get; set; }
+ /// Specifies the network interfaces for the AzureBareMetal instance.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkProfileNetworkInterface { get; set; }
+ /// Specifies the operating system settings for the AzureBareMetal instance.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile OSProfile { get; set; }
+ /// Specifies the host OS name of the AzureBareMetal instance.
+ string OSProfileComputerName { get; set; }
+ /// This property allows you to specify the type of the OS.
+ string OSProfileOstype { get; set; }
+ /// Specifies the SSH public key used to access the operating system.
+ string OSProfileSshPublicKey { get; set; }
+ /// Specifies version of operating system.
+ string OSProfileVersion { get; set; }
+ ///
+ /// ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance
+ ///
+ string PartnerNodeId { get; set; }
+ /// Resource power state
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum? PowerState { get; set; }
+ /// State of provisioning of the AzureBareMetalInstance
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum? ProvisioningState { get; set; }
+ /// Resource proximity placement group
+ string ProximityPlacementGroup { get; set; }
+ /// Specifies the storage settings for the AzureBareMetal instance disks.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile StorageProfile { get; set; }
+ /// IP Address to connect to storage.
+ string StorageProfileNfsIPAddress { get; set; }
+ ///
+ /// Specifies information about the operating system disk used by baremetal instance.
+ ///
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] StorageProfileOSDisk { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.json.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.json.cs
new file mode 100644
index 000000000000..55f807ca1212
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstanceProperties.json.cs
@@ -0,0 +1,139 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Describes the properties of an AzureBareMetal instance.
+ public partial class AzureBareMetalInstanceProperties
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal AzureBareMetalInstanceProperties(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_hardwareProfile = If( json?.PropertyT("hardwareProfile"), out var __jsonHardwareProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.HardwareProfile.FromJson(__jsonHardwareProfile) : HardwareProfile;}
+ {_storageProfile = If( json?.PropertyT("storageProfile"), out var __jsonStorageProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.StorageProfile.FromJson(__jsonStorageProfile) : StorageProfile;}
+ {_oSProfile = If( json?.PropertyT("osProfile"), out var __jsonOSProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OSProfile.FromJson(__jsonOSProfile) : OSProfile;}
+ {_networkProfile = If( json?.PropertyT("networkProfile"), out var __jsonNetworkProfile) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.NetworkProfile.FromJson(__jsonNetworkProfile) : NetworkProfile;}
+ {_azureBareMetalInstanceId = If( json?.PropertyT("azureBareMetalInstanceId"), out var __jsonAzureBareMetalInstanceId) ? (string)__jsonAzureBareMetalInstanceId : (string)AzureBareMetalInstanceId;}
+ {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? (string)__jsonPowerState : (string)PowerState;}
+ {_proximityPlacementGroup = If( json?.PropertyT("proximityPlacementGroup"), out var __jsonProximityPlacementGroup) ? (string)__jsonProximityPlacementGroup : (string)ProximityPlacementGroup;}
+ {_hwRevision = If( json?.PropertyT("hwRevision"), out var __jsonHwRevision) ? (string)__jsonHwRevision : (string)HwRevision;}
+ {_partnerNodeId = If( json?.PropertyT("partnerNodeId"), out var __jsonPartnerNodeId) ? (string)__jsonPartnerNodeId : (string)PartnerNodeId;}
+ {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstanceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new AzureBareMetalInstanceProperties(json) : null;
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != this._hardwareProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._hardwareProfile.ToJson(null,serializationMode) : null, "hardwareProfile" ,container.Add );
+ AddIf( null != this._storageProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._storageProfile.ToJson(null,serializationMode) : null, "storageProfile" ,container.Add );
+ AddIf( null != this._oSProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._oSProfile.ToJson(null,serializationMode) : null, "osProfile" ,container.Add );
+ AddIf( null != this._networkProfile ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._networkProfile.ToJson(null,serializationMode) : null, "networkProfile" ,container.Add );
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._azureBareMetalInstanceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._azureBareMetalInstanceId.ToString()) : null, "azureBareMetalInstanceId" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._powerState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._powerState.ToString()) : null, "powerState" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._proximityPlacementGroup)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._proximityPlacementGroup.ToString()) : null, "proximityPlacementGroup" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._hwRevision)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._hwRevision.ToString()) : null, "hwRevision" ,container.Add );
+ }
+ AddIf( null != (((object)this._partnerNodeId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._partnerNodeId.ToString()) : null, "partnerNodeId" ,container.Add );
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add );
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.PowerShell.cs
new file mode 100644
index 000000000000..e23e364f7912
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.PowerShell.cs
@@ -0,0 +1,172 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// The response from the List AzureBareMetal Instances operation.
+ [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstancesListResultTypeConverter))]
+ public partial class AzureBareMetalInstancesListResult
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of 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 AzureBareMetalInstancesListResult(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NextLink"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).NextLink, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal AzureBareMetalInstancesListResult(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstanceTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("NextLink"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal)this).NextLink, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new AzureBareMetalInstancesListResult(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new AzureBareMetalInstancesListResult(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// The response from the List AzureBareMetal Instances operation.
+ [System.ComponentModel.TypeConverter(typeof(AzureBareMetalInstancesListResultTypeConverter))]
+ public partial interface IAzureBareMetalInstancesListResult
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.TypeConverter.cs
new file mode 100644
index 000000000000..e5eda7f965e5
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class AzureBareMetalInstancesListResultTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return AzureBareMetalInstancesListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return AzureBareMetalInstancesListResult.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return AzureBareMetalInstancesListResult.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.cs
new file mode 100644
index 000000000000..75327536ac70
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// The response from the List AzureBareMetal Instances operation.
+ public partial class AzureBareMetalInstancesListResult :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResultInternal
+ {
+
+ /// Backing field for property.
+ private string _nextLink;
+
+ /// The URL to get the next set of AzureBareMetal instances.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string NextLink { get => this._nextLink; set => this._nextLink = value; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[] _value;
+
+ /// The list of Azure BareMetal instances.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[] Value { get => this._value; set => this._value = value; }
+
+ /// Creates an new instance.
+ public AzureBareMetalInstancesListResult()
+ {
+
+ }
+ }
+ /// The response from the List AzureBareMetal Instances operation.
+ public partial interface IAzureBareMetalInstancesListResult :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// The URL to get the next set of AzureBareMetal instances.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The URL to get the next set of AzureBareMetal instances.",
+ SerializedName = @"nextLink",
+ PossibleTypes = new [] { typeof(string) })]
+ string NextLink { get; set; }
+ /// The list of Azure BareMetal instances.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The list of Azure BareMetal instances.",
+ SerializedName = @"value",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[] Value { get; set; }
+
+ }
+ /// The response from the List AzureBareMetal Instances operation.
+ internal partial interface IAzureBareMetalInstancesListResultInternal
+
+ {
+ /// The URL to get the next set of AzureBareMetal instances.
+ string NextLink { get; set; }
+ /// The list of Azure BareMetal instances.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance[] Value { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.json.cs b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.json.cs
new file mode 100644
index 000000000000..f30cdccfff69
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/AzureBareMetalInstancesListResult.json.cs
@@ -0,0 +1,116 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// The response from the List AzureBareMetal Instances operation.
+ public partial class AzureBareMetalInstancesListResult
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal AzureBareMetalInstancesListResult(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IAzureBareMetalInstance) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.AzureBareMetalInstance.FromJson(__u) )) ))() : null : Value;}
+ {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstancesListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new AzureBareMetalInstancesListResult(json) : null;
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (null != this._value)
+ {
+ var __w = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.XNodeArray();
+ foreach( var __x in this._value )
+ {
+ AddIf(__x?.ToJson(null, serializationMode) ,__w.Add);
+ }
+ container.Add("value",__w);
+ }
+ AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Disk.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/Disk.PowerShell.cs
new file mode 100644
index 000000000000..143dcf1f69cc
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Disk.PowerShell.cs
@@ -0,0 +1,178 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Specifies the disk information fo the AzureBareMetal instance
+ [System.ComponentModel.TypeConverter(typeof(DiskTypeConverter))]
+ public partial class Disk
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new Disk(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new Disk(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal Disk(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Name, global::System.Convert.ToString);
+ }
+ if (content.Contains("SizeGb"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).SizeGb = (int?) content.GetValueForProperty("SizeGb",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).SizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
+ }
+ if (content.Contains("Lun"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Lun = (int?) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Lun, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal Disk(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Name, global::System.Convert.ToString);
+ }
+ if (content.Contains("SizeGb"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).SizeGb = (int?) content.GetValueForProperty("SizeGb",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).SizeGb, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
+ }
+ if (content.Contains("Lun"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Lun = (int?) content.GetValueForProperty("Lun",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal)this).Lun, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int)));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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();
+ }
+ }
+ /// Specifies the disk information fo the AzureBareMetal instance
+ [System.ComponentModel.TypeConverter(typeof(DiskTypeConverter))]
+ public partial interface IDisk
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Disk.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/Disk.TypeConverter.cs
new file mode 100644
index 000000000000..fcef62b0542c
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Disk.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class DiskTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return Disk.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return Disk.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return Disk.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Disk.cs b/src/BareMetal/generated/api/Models/Api20210809/Disk.cs
new file mode 100644
index 000000000000..30154728b162
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Disk.cs
@@ -0,0 +1,97 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the disk information fo the AzureBareMetal instance
+ public partial class Disk :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal
+ {
+
+ /// Backing field for property.
+ private int? _lun;
+
+ ///
+ /// Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore
+ /// must be unique for each data disk attached to a VM.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public int? Lun { get => this._lun; }
+
+ /// Internal Acessors for Lun
+ int? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDiskInternal.Lun { get => this._lun; set { {_lun = value;} } }
+
+ /// Backing field for property.
+ private string _name;
+
+ /// The disk name.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Name { get => this._name; set => this._name = value; }
+
+ /// Backing field for property.
+ private int? _sizeGb;
+
+ /// Specifies the size of an empty data disk in gigabytes.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public int? SizeGb { get => this._sizeGb; set => this._sizeGb = value; }
+
+ /// Creates an new instance.
+ public Disk()
+ {
+
+ }
+ }
+ /// Specifies the disk information fo the AzureBareMetal instance
+ public partial interface IDisk :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ ///
+ /// Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore
+ /// must be unique for each data disk attached to a VM.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.",
+ SerializedName = @"lun",
+ PossibleTypes = new [] { typeof(int) })]
+ int? Lun { get; }
+ /// The disk name.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The disk name.",
+ SerializedName = @"name",
+ PossibleTypes = new [] { typeof(string) })]
+ string Name { get; set; }
+ /// Specifies the size of an empty data disk in gigabytes.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the size of an empty data disk in gigabytes.",
+ SerializedName = @"diskSizeGB",
+ PossibleTypes = new [] { typeof(int) })]
+ int? SizeGb { get; set; }
+
+ }
+ /// Specifies the disk information fo the AzureBareMetal instance
+ internal partial interface IDiskInternal
+
+ {
+ ///
+ /// Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore
+ /// must be unique for each data disk attached to a VM.
+ ///
+ int? Lun { get; set; }
+ /// The disk name.
+ string Name { get; set; }
+ /// Specifies the size of an empty data disk in gigabytes.
+ int? SizeGb { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Disk.json.cs b/src/BareMetal/generated/api/Models/Api20210809/Disk.json.cs
new file mode 100644
index 000000000000..fcc0772059ad
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Disk.json.cs
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the disk information fo the AzureBareMetal instance
+ public partial class Disk
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal Disk(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;}
+ {_sizeGb = If( json?.PropertyT("diskSizeGB"), out var __jsonDiskSizeGb) ? (int?)__jsonDiskSizeGb : SizeGb;}
+ {_lun = If( json?.PropertyT("lun"), out var __jsonLun) ? (int?)__jsonLun : Lun;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Disk(json) : null;
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add );
+ AddIf( null != this._sizeGb ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNumber((int)this._sizeGb) : null, "diskSizeGB" ,container.Add );
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != this._lun ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNumber((int)this._lun) : null, "lun" ,container.Add );
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Display.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/Display.PowerShell.cs
new file mode 100644
index 000000000000..77ab88dcdca2
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Display.PowerShell.cs
@@ -0,0 +1,186 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Detailed BareMetal operation information
+ [System.ComponentModel.TypeConverter(typeof(DisplayTypeConverter))]
+ public partial class Display
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new Display(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new Display(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal Display(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Provider"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Provider, global::System.Convert.ToString);
+ }
+ if (content.Contains("Resource"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Resource, global::System.Convert.ToString);
+ }
+ if (content.Contains("Operation"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Operation, global::System.Convert.ToString);
+ }
+ if (content.Contains("Description"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Description, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal Display(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Provider"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Provider, global::System.Convert.ToString);
+ }
+ if (content.Contains("Resource"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Resource, global::System.Convert.ToString);
+ }
+ if (content.Contains("Operation"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Operation, global::System.Convert.ToString);
+ }
+ if (content.Contains("Description"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)this).Description, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.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();
+ }
+ }
+ /// Detailed BareMetal operation information
+ [System.ComponentModel.TypeConverter(typeof(DisplayTypeConverter))]
+ public partial interface IDisplay
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Display.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/Display.TypeConverter.cs
new file mode 100644
index 000000000000..cfa86474a2d5
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Display.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class DisplayTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return Display.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return Display.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return Display.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Display.cs b/src/BareMetal/generated/api/Models/Api20210809/Display.cs
new file mode 100644
index 000000000000..a86d682d4675
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Display.cs
@@ -0,0 +1,120 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Detailed BareMetal operation information
+ public partial class Display :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal
+ {
+
+ /// Backing field for property.
+ private string _description;
+
+ /// The localized friendly description for the operation as shown to the user.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Description { get => this._description; }
+
+ /// Internal Acessors for Description
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal.Description { get => this._description; set { {_description = value;} } }
+
+ /// Internal Acessors for Operation
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } }
+
+ /// Internal Acessors for Provider
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } }
+
+ /// Internal Acessors for Resource
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } }
+
+ /// Backing field for property.
+ private string _operation;
+
+ /// The localized friendly name for the operation as shown to the user.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Operation { get => this._operation; }
+
+ /// Backing field for property.
+ private string _provider;
+
+ /// The localized friendly form of the resource provider name.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Provider { get => this._provider; }
+
+ /// Backing field for property.
+ private string _resource;
+
+ ///
+ /// The localized friendly form of the resource type related to this action/operation.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Resource { get => this._resource; }
+
+ /// Creates an new instance.
+ public Display()
+ {
+
+ }
+ }
+ /// Detailed BareMetal operation information
+ public partial interface IDisplay :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// The localized friendly description for the operation as shown to the user.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The localized friendly description for the operation as shown to the user.",
+ SerializedName = @"description",
+ PossibleTypes = new [] { typeof(string) })]
+ string Description { get; }
+ /// The localized friendly name for the operation as shown to the user.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The localized friendly name for the operation as shown to the user.",
+ SerializedName = @"operation",
+ PossibleTypes = new [] { typeof(string) })]
+ string Operation { get; }
+ /// The localized friendly form of the resource provider name.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The localized friendly form of the resource provider name.",
+ SerializedName = @"provider",
+ PossibleTypes = new [] { typeof(string) })]
+ string Provider { get; }
+ ///
+ /// The localized friendly form of the resource type related to this action/operation.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The localized friendly form of the resource type related to this action/operation.",
+ SerializedName = @"resource",
+ PossibleTypes = new [] { typeof(string) })]
+ string Resource { get; }
+
+ }
+ /// Detailed BareMetal operation information
+ internal partial interface IDisplayInternal
+
+ {
+ /// The localized friendly description for the operation as shown to the user.
+ string Description { get; set; }
+ /// The localized friendly name for the operation as shown to the user.
+ string Operation { get; set; }
+ /// The localized friendly form of the resource provider name.
+ string Provider { get; set; }
+ ///
+ /// The localized friendly form of the resource type related to this action/operation.
+ ///
+ string Resource { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Display.json.cs b/src/BareMetal/generated/api/Models/Api20210809/Display.json.cs
new file mode 100644
index 000000000000..f02f0829bca0
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Display.json.cs
@@ -0,0 +1,124 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Detailed BareMetal operation information
+ public partial class Display
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal Display(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;}
+ {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;}
+ {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;}
+ {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Display(json) : null;
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add );
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.PowerShell.cs
new file mode 100644
index 000000000000..49bb03e47a85
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.PowerShell.cs
@@ -0,0 +1,178 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Error definition.
+ [System.ComponentModel.TypeConverter(typeof(ErrorDefinitionTypeConverter))]
+ public partial class ErrorDefinition
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new ErrorDefinition(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new ErrorDefinition(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal ErrorDefinition(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Code"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Code, global::System.Convert.ToString);
+ }
+ if (content.Contains("Message"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Message, global::System.Convert.ToString);
+ }
+ if (content.Contains("Detail"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal ErrorDefinition(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Code"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Code, global::System.Convert.ToString);
+ }
+ if (content.Contains("Message"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Message, global::System.Convert.ToString);
+ }
+ if (content.Contains("Detail"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// Error definition.
+ [System.ComponentModel.TypeConverter(typeof(ErrorDefinitionTypeConverter))]
+ public partial interface IErrorDefinition
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.TypeConverter.cs
new file mode 100644
index 000000000000..e275f54c0fb5
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class ErrorDefinitionTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return ErrorDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return ErrorDefinition.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return ErrorDefinition.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.cs b/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.cs
new file mode 100644
index 000000000000..32893e14c320
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.cs
@@ -0,0 +1,100 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Error definition.
+ public partial class ErrorDefinition :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal
+ {
+
+ /// Backing field for property.
+ private string _code;
+
+ ///
+ /// Service specific error code which serves as the substatus for the HTTP error code.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Code { get => this._code; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] _detail;
+
+ /// Internal error details.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get => this._detail; }
+
+ /// Backing field for property.
+ private string _message;
+
+ /// Description of the error.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Message { get => this._message; }
+
+ /// Internal Acessors for Code
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal.Code { get => this._code; set { {_code = value;} } }
+
+ /// Internal Acessors for Detail
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal.Detail { get => this._detail; set { {_detail = value;} } }
+
+ /// Internal Acessors for Message
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal.Message { get => this._message; set { {_message = value;} } }
+
+ /// Creates an new instance.
+ public ErrorDefinition()
+ {
+
+ }
+ }
+ /// Error definition.
+ public partial interface IErrorDefinition :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ ///
+ /// Service specific error code which serves as the substatus for the HTTP error code.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Service specific error code which serves as the substatus for the HTTP error code.",
+ SerializedName = @"code",
+ PossibleTypes = new [] { typeof(string) })]
+ string Code { get; }
+ /// Internal error details.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Internal error details.",
+ SerializedName = @"details",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get; }
+ /// Description of the error.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Description of the error.",
+ SerializedName = @"message",
+ PossibleTypes = new [] { typeof(string) })]
+ string Message { get; }
+
+ }
+ /// Error definition.
+ internal partial interface IErrorDefinitionInternal
+
+ {
+ ///
+ /// Service specific error code which serves as the substatus for the HTTP error code.
+ ///
+ string Code { get; set; }
+ /// Internal error details.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get; set; }
+ /// Description of the error.
+ string Message { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.json.cs b/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.json.cs
new file mode 100644
index 000000000000..52a662bb675f
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/ErrorDefinition.json.cs
@@ -0,0 +1,127 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Error definition.
+ public partial class ErrorDefinition
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal ErrorDefinition(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;}
+ {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;}
+ {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IErrorDefinition) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition.FromJson(__u) )) ))() : null : Detail;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new ErrorDefinition(json) : null;
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ if (null != this._detail)
+ {
+ var __w = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.XNodeArray();
+ foreach( var __x in this._detail )
+ {
+ AddIf(__x?.ToJson(null, serializationMode) ,__w.Add);
+ }
+ container.Add("details",__w);
+ }
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.PowerShell.cs
new file mode 100644
index 000000000000..e8a987aaa13a
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.PowerShell.cs
@@ -0,0 +1,186 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Error response.
+ [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))]
+ public partial class ErrorResponse
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new ErrorResponse(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new ErrorResponse(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal ErrorResponse(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Error"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Code"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Code, global::System.Convert.ToString);
+ }
+ if (content.Contains("Message"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Message, global::System.Convert.ToString);
+ }
+ if (content.Contains("Detail"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal ErrorResponse(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Error"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Code"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Code, global::System.Convert.ToString);
+ }
+ if (content.Contains("Message"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Message, global::System.Convert.ToString);
+ }
+ if (content.Contains("Detail"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinitionTypeConverter.ConvertFrom));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// Error response.
+ [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))]
+ public partial interface IErrorResponse
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.TypeConverter.cs
new file mode 100644
index 000000000000..bf09c535c472
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class ErrorResponseTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return ErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return ErrorResponse.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return ErrorResponse.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.cs b/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.cs
new file mode 100644
index 000000000000..c9110a047a7d
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.cs
@@ -0,0 +1,103 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Error response.
+ public partial class ErrorResponse :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal
+ {
+
+ ///
+ /// Service specific error code which serves as the substatus for the HTTP error code.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Code; }
+
+ /// Internal error details.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Detail; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition _error;
+
+ /// The error details.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition()); set => this._error = value; }
+
+ /// Description of the error.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Message; }
+
+ /// Internal Acessors for Code
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Code = value; }
+
+ /// Internal Acessors for Detail
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Detail = value; }
+
+ /// Internal Acessors for Error
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition()); set { {_error = value;} } }
+
+ /// Internal Acessors for Message
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinitionInternal)Error).Message = value; }
+
+ /// Creates an new instance.
+ public ErrorResponse()
+ {
+
+ }
+ }
+ /// Error response.
+ public partial interface IErrorResponse :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ ///
+ /// Service specific error code which serves as the substatus for the HTTP error code.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Service specific error code which serves as the substatus for the HTTP error code.",
+ SerializedName = @"code",
+ PossibleTypes = new [] { typeof(string) })]
+ string Code { get; }
+ /// Internal error details.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Internal error details.",
+ SerializedName = @"details",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get; }
+ /// Description of the error.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Description of the error.",
+ SerializedName = @"message",
+ PossibleTypes = new [] { typeof(string) })]
+ string Message { get; }
+
+ }
+ /// Error response.
+ internal partial interface IErrorResponseInternal
+
+ {
+ ///
+ /// Service specific error code which serves as the substatus for the HTTP error code.
+ ///
+ string Code { get; set; }
+ /// Internal error details.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition[] Detail { get; set; }
+ /// The error details.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorDefinition Error { get; set; }
+ /// Description of the error.
+ string Message { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.json.cs b/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.json.cs
new file mode 100644
index 000000000000..6b9df89f4611
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/ErrorResponse.json.cs
@@ -0,0 +1,106 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Error response.
+ public partial class ErrorResponse
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ErrorDefinition.FromJson(__jsonError) : Error;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null;
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.PowerShell.cs
new file mode 100644
index 000000000000..67b77698ac3f
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.PowerShell.cs
@@ -0,0 +1,170 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Specifies the hardware settings for the AzureBareMetal instance.
+ [System.ComponentModel.TypeConverter(typeof(HardwareProfileTypeConverter))]
+ public partial class HardwareProfile
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new HardwareProfile(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new HardwareProfile(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal HardwareProfile(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("HardwareType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).HardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).HardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom);
+ }
+ if (content.Contains("AzureBareMetalInstanceSize"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).AzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("AzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).AzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal HardwareProfile(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("HardwareType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).HardwareType = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum?) content.GetValueForProperty("HardwareType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).HardwareType, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum.CreateFrom);
+ }
+ if (content.Contains("AzureBareMetalInstanceSize"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).AzureBareMetalInstanceSize = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum?) content.GetValueForProperty("AzureBareMetalInstanceSize",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal)this).AzureBareMetalInstanceSize, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum.CreateFrom);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// Specifies the hardware settings for the AzureBareMetal instance.
+ [System.ComponentModel.TypeConverter(typeof(HardwareProfileTypeConverter))]
+ public partial interface IHardwareProfile
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.TypeConverter.cs
new file mode 100644
index 000000000000..002f9f12aa33
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class HardwareProfileTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return HardwareProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return HardwareProfile.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return HardwareProfile.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.cs b/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.cs
new file mode 100644
index 000000000000..8f1c1b2f27e7
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.cs
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the hardware settings for the AzureBareMetal instance.
+ public partial class HardwareProfile :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal
+ {
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? _azureBareMetalInstanceSize;
+
+ /// Specifies the AzureBareMetal instance SKU.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? AzureBareMetalInstanceSize { get => this._azureBareMetalInstanceSize; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? _hardwareType;
+
+ /// Name of the hardware type (vendor and/or their product name)
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareType { get => this._hardwareType; }
+
+ /// Internal Acessors for AzureBareMetalInstanceSize
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal.AzureBareMetalInstanceSize { get => this._azureBareMetalInstanceSize; set { {_azureBareMetalInstanceSize = value;} } }
+
+ /// Internal Acessors for HardwareType
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfileInternal.HardwareType { get => this._hardwareType; set { {_hardwareType = value;} } }
+
+ /// Creates an new instance.
+ public HardwareProfile()
+ {
+
+ }
+ }
+ /// Specifies the hardware settings for the AzureBareMetal instance.
+ public partial interface IHardwareProfile :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// Specifies the AzureBareMetal instance SKU.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies the AzureBareMetal instance SKU.",
+ SerializedName = @"azureBareMetalInstanceSize",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? AzureBareMetalInstanceSize { get; }
+ /// Name of the hardware type (vendor and/or their product name)
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Name of the hardware type (vendor and/or their product name)",
+ SerializedName = @"hardwareType",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareType { get; }
+
+ }
+ /// Specifies the hardware settings for the AzureBareMetal instance.
+ internal partial interface IHardwareProfileInternal
+
+ {
+ /// Specifies the AzureBareMetal instance SKU.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum? AzureBareMetalInstanceSize { get; set; }
+ /// Name of the hardware type (vendor and/or their product name)
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum? HardwareType { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.json.cs b/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.json.cs
new file mode 100644
index 000000000000..f2a6d4e00f7d
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/HardwareProfile.json.cs
@@ -0,0 +1,114 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the hardware settings for the AzureBareMetal instance.
+ public partial class HardwareProfile
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IHardwareProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new HardwareProfile(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal HardwareProfile(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_hardwareType = If( json?.PropertyT("hardwareType"), out var __jsonHardwareType) ? (string)__jsonHardwareType : (string)HardwareType;}
+ {_azureBareMetalInstanceSize = If( json?.PropertyT("azureBareMetalInstanceSize"), out var __jsonAzureBareMetalInstanceSize) ? (string)__jsonAzureBareMetalInstanceSize : (string)AzureBareMetalInstanceSize;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._hardwareType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._hardwareType.ToString()) : null, "hardwareType" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._azureBareMetalInstanceSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._azureBareMetalInstanceSize.ToString()) : null, "azureBareMetalInstanceSize" ,container.Add );
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/IPAddress.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/IPAddress.PowerShell.cs
new file mode 100644
index 000000000000..82e8adb7e668
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/IPAddress.PowerShell.cs
@@ -0,0 +1,162 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Specifies the IP address of the network interface.
+ [System.ComponentModel.TypeConverter(typeof(IPAddressTypeConverter))]
+ public partial class IPAddress
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new IPAddress(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new IPAddress(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal IPAddress(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("IPAddress1"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddressInternal)this).IPAddress1 = (string) content.GetValueForProperty("IPAddress1",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddressInternal)this).IPAddress1, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal IPAddress(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("IPAddress1"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddressInternal)this).IPAddress1 = (string) content.GetValueForProperty("IPAddress1",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddressInternal)this).IPAddress1, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// Specifies the IP address of the network interface.
+ [System.ComponentModel.TypeConverter(typeof(IPAddressTypeConverter))]
+ public partial interface IIPAddress
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/IPAddress.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/IPAddress.TypeConverter.cs
new file mode 100644
index 000000000000..78032ea02b8d
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/IPAddress.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class IPAddressTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return IPAddress.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return IPAddress.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return IPAddress.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/IPAddress.cs b/src/BareMetal/generated/api/Models/Api20210809/IPAddress.cs
new file mode 100644
index 000000000000..2773d4d459f6
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/IPAddress.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the IP address of the network interface.
+ public partial class IPAddress :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddressInternal
+ {
+
+ /// Backing field for property.
+ private string _iPAddress1;
+
+ /// Specifies the IP address of the network interface.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string IPAddress1 { get => this._iPAddress1; set => this._iPAddress1 = value; }
+
+ /// Creates an new instance.
+ public IPAddress()
+ {
+
+ }
+ }
+ /// Specifies the IP address of the network interface.
+ public partial interface IIPAddress :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// Specifies the IP address of the network interface.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the IP address of the network interface.",
+ SerializedName = @"ipAddress",
+ PossibleTypes = new [] { typeof(string) })]
+ string IPAddress1 { get; set; }
+
+ }
+ /// Specifies the IP address of the network interface.
+ internal partial interface IIPAddressInternal
+
+ {
+ /// Specifies the IP address of the network interface.
+ string IPAddress1 { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/IPAddress.json.cs b/src/BareMetal/generated/api/Models/Api20210809/IPAddress.json.cs
new file mode 100644
index 000000000000..9e08545e47ab
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/IPAddress.json.cs
@@ -0,0 +1,106 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the IP address of the network interface.
+ public partial class IPAddress
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new IPAddress(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal IPAddress(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_iPAddress1 = If( json?.PropertyT("ipAddress"), out var __jsonIPAddress) ? (string)__jsonIPAddress : (string)IPAddress1;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != (((object)this._iPAddress1)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._iPAddress1.ToString()) : null, "ipAddress" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.PowerShell.cs
new file mode 100644
index 000000000000..17b3de087082
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.PowerShell.cs
@@ -0,0 +1,170 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Specifies the network settings for the AzureBareMetal instance disks.
+ [System.ComponentModel.TypeConverter(typeof(NetworkProfileTypeConverter))]
+ public partial class NetworkProfile
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new NetworkProfile(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new NetworkProfile(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal NetworkProfile(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("NetworkInterface"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).NetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("CircuitId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).CircuitId = (string) content.GetValueForProperty("CircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).CircuitId, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal NetworkProfile(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("NetworkInterface"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).NetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[]) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddressTypeConverter.ConvertFrom));
+ }
+ if (content.Contains("CircuitId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).CircuitId = (string) content.GetValueForProperty("CircuitId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal)this).CircuitId, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// Specifies the network settings for the AzureBareMetal instance disks.
+ [System.ComponentModel.TypeConverter(typeof(NetworkProfileTypeConverter))]
+ public partial interface INetworkProfile
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.TypeConverter.cs
new file mode 100644
index 000000000000..baaf28eb310f
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class NetworkProfileTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return NetworkProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return NetworkProfile.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return NetworkProfile.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.cs b/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.cs
new file mode 100644
index 000000000000..881db5e5db7f
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.cs
@@ -0,0 +1,71 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the network settings for the AzureBareMetal instance disks.
+ public partial class NetworkProfile :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal
+ {
+
+ /// Backing field for property.
+ private string _circuitId;
+
+ /// Specifies the circuit id for connecting to express route.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string CircuitId { get => this._circuitId; }
+
+ /// Internal Acessors for CircuitId
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfileInternal.CircuitId { get => this._circuitId; set { {_circuitId = value;} } }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] _networkInterface;
+
+ /// Specifies the network interfaces for the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkInterface { get => this._networkInterface; set => this._networkInterface = value; }
+
+ /// Creates an new instance.
+ public NetworkProfile()
+ {
+
+ }
+ }
+ /// Specifies the network settings for the AzureBareMetal instance disks.
+ public partial interface INetworkProfile :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// Specifies the circuit id for connecting to express route.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies the circuit id for connecting to express route.",
+ SerializedName = @"circuitId",
+ PossibleTypes = new [] { typeof(string) })]
+ string CircuitId { get; }
+ /// Specifies the network interfaces for the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the network interfaces for the AzureBareMetal instance.",
+ SerializedName = @"networkInterfaces",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkInterface { get; set; }
+
+ }
+ /// Specifies the network settings for the AzureBareMetal instance disks.
+ internal partial interface INetworkProfileInternal
+
+ {
+ /// Specifies the circuit id for connecting to express route.
+ string CircuitId { get; set; }
+ /// Specifies the network interfaces for the AzureBareMetal instance.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IIPAddress[] NetworkInterface { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.json.cs b/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.json.cs
new file mode 100644
index 000000000000..3a394e51686b
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/NetworkProfile.json.cs
@@ -0,0 +1,119 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the network settings for the AzureBareMetal instance disks.
+ public partial class NetworkProfile
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.INetworkProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new NetworkProfile(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal NetworkProfile(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_networkInterface = If( json?.PropertyT("networkInterfaces"), out var __jsonNetworkInterfaces) ? If( __jsonNetworkInterfaces as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IIPAddress) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IPAddress.FromJson(__u) )) ))() : null : NetworkInterface;}
+ {_circuitId = If( json?.PropertyT("circuitId"), out var __jsonCircuitId) ? (string)__jsonCircuitId : (string)CircuitId;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (null != this._networkInterface)
+ {
+ var __w = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.XNodeArray();
+ foreach( var __x in this._networkInterface )
+ {
+ AddIf(__x?.ToJson(null, serializationMode) ,__w.Add);
+ }
+ container.Add("networkInterfaces",__w);
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._circuitId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._circuitId.ToString()) : null, "circuitId" ,container.Add );
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/OSProfile.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/OSProfile.PowerShell.cs
new file mode 100644
index 000000000000..f078776f355d
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/OSProfile.PowerShell.cs
@@ -0,0 +1,186 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Specifies the operating system settings for the AzureBareMetal instance.
+ [System.ComponentModel.TypeConverter(typeof(OSProfileTypeConverter))]
+ public partial class OSProfile
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new OSProfile(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new OSProfile(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal OSProfile(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("ComputerName"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).ComputerName = (string) content.GetValueForProperty("ComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).ComputerName, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).OSType, global::System.Convert.ToString);
+ }
+ if (content.Contains("Version"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).Version, global::System.Convert.ToString);
+ }
+ if (content.Contains("SshPublicKey"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).SshPublicKey = (string) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).SshPublicKey, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal OSProfile(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("ComputerName"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).ComputerName = (string) content.GetValueForProperty("ComputerName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).ComputerName, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSType"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).OSType = (string) content.GetValueForProperty("OSType",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).OSType, global::System.Convert.ToString);
+ }
+ if (content.Contains("Version"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).Version, global::System.Convert.ToString);
+ }
+ if (content.Contains("SshPublicKey"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).SshPublicKey = (string) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal)this).SshPublicKey, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// Specifies the operating system settings for the AzureBareMetal instance.
+ [System.ComponentModel.TypeConverter(typeof(OSProfileTypeConverter))]
+ public partial interface IOSProfile
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/OSProfile.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/OSProfile.TypeConverter.cs
new file mode 100644
index 000000000000..4fdcb1a93e8f
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/OSProfile.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class OSProfileTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return OSProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return OSProfile.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return OSProfile.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/OSProfile.cs b/src/BareMetal/generated/api/Models/Api20210809/OSProfile.cs
new file mode 100644
index 000000000000..ef96bcea57b7
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/OSProfile.cs
@@ -0,0 +1,108 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the operating system settings for the AzureBareMetal instance.
+ public partial class OSProfile :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal
+ {
+
+ /// Backing field for property.
+ private string _computerName;
+
+ /// Specifies the host OS name of the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string ComputerName { get => this._computerName; set => this._computerName = value; }
+
+ /// Internal Acessors for OSType
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal.OSType { get => this._oSType; set { {_oSType = value;} } }
+
+ /// Internal Acessors for Version
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfileInternal.Version { get => this._version; set { {_version = value;} } }
+
+ /// Backing field for property.
+ private string _oSType;
+
+ /// This property allows you to specify the type of the OS.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string OSType { get => this._oSType; }
+
+ /// Backing field for property.
+ private string _sshPublicKey;
+
+ /// Specifies the SSH public key used to access the operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string SshPublicKey { get => this._sshPublicKey; set => this._sshPublicKey = value; }
+
+ /// Backing field for property.
+ private string _version;
+
+ /// Specifies version of operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Version { get => this._version; }
+
+ /// Creates an new instance.
+ public OSProfile()
+ {
+
+ }
+ }
+ /// Specifies the operating system settings for the AzureBareMetal instance.
+ public partial interface IOSProfile :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// Specifies the host OS name of the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the host OS name of the AzureBareMetal instance.",
+ SerializedName = @"computerName",
+ PossibleTypes = new [] { typeof(string) })]
+ string ComputerName { get; set; }
+ /// This property allows you to specify the type of the OS.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"This property allows you to specify the type of the OS.",
+ SerializedName = @"osType",
+ PossibleTypes = new [] { typeof(string) })]
+ string OSType { get; }
+ /// Specifies the SSH public key used to access the operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies the SSH public key used to access the operating system.",
+ SerializedName = @"sshPublicKey",
+ PossibleTypes = new [] { typeof(string) })]
+ string SshPublicKey { get; set; }
+ /// Specifies version of operating system.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"Specifies version of operating system.",
+ SerializedName = @"version",
+ PossibleTypes = new [] { typeof(string) })]
+ string Version { get; }
+
+ }
+ /// Specifies the operating system settings for the AzureBareMetal instance.
+ internal partial interface IOSProfileInternal
+
+ {
+ /// Specifies the host OS name of the AzureBareMetal instance.
+ string ComputerName { get; set; }
+ /// This property allows you to specify the type of the OS.
+ string OSType { get; set; }
+ /// Specifies the SSH public key used to access the operating system.
+ string SshPublicKey { get; set; }
+ /// Specifies version of operating system.
+ string Version { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/OSProfile.json.cs b/src/BareMetal/generated/api/Models/Api20210809/OSProfile.json.cs
new file mode 100644
index 000000000000..3eff7f6a1502
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/OSProfile.json.cs
@@ -0,0 +1,118 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the operating system settings for the AzureBareMetal instance.
+ public partial class OSProfile
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOSProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new OSProfile(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal OSProfile(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_computerName = If( json?.PropertyT("computerName"), out var __jsonComputerName) ? (string)__jsonComputerName : (string)ComputerName;}
+ {_oSType = If( json?.PropertyT("osType"), out var __jsonOSType) ? (string)__jsonOSType : (string)OSType;}
+ {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;}
+ {_sshPublicKey = If( json?.PropertyT("sshPublicKey"), out var __jsonSshPublicKey) ? (string)__jsonSshPublicKey : (string)SshPublicKey;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != (((object)this._computerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._computerName.ToString()) : null, "computerName" ,container.Add );
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._oSType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._oSType.ToString()) : null, "osType" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add );
+ }
+ AddIf( null != (((object)this._sshPublicKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._sshPublicKey.ToString()) : null, "sshPublicKey" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Operation.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/Operation.PowerShell.cs
new file mode 100644
index 000000000000..b48a5bda1642
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Operation.PowerShell.cs
@@ -0,0 +1,210 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// AzureBareMetal operation information
+ [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))]
+ public partial class Operation
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new Operation(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new Operation(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal Operation(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Display"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DisplayTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Name, global::System.Convert.ToString);
+ }
+ if (content.Contains("IsDataAction"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
+ }
+ if (content.Contains("DisplayProvider"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString);
+ }
+ if (content.Contains("DisplayResource"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayResource, global::System.Convert.ToString);
+ }
+ if (content.Contains("DisplayOperation"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString);
+ }
+ if (content.Contains("DisplayDescription"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal Operation(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Display"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DisplayTypeConverter.ConvertFrom);
+ }
+ if (content.Contains("Name"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).Name, global::System.Convert.ToString);
+ }
+ if (content.Contains("IsDataAction"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
+ }
+ if (content.Contains("DisplayProvider"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString);
+ }
+ if (content.Contains("DisplayResource"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayResource, global::System.Convert.ToString);
+ }
+ if (content.Contains("DisplayOperation"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString);
+ }
+ if (content.Contains("DisplayDescription"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// AzureBareMetal operation information
+ [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))]
+ public partial interface IOperation
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Operation.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/Operation.TypeConverter.cs
new file mode 100644
index 000000000000..b286b275d7ce
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Operation.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class OperationTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return Operation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return Operation.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return Operation.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Operation.cs b/src/BareMetal/generated/api/Models/Api20210809/Operation.cs
new file mode 100644
index 000000000000..4f4d13863b29
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Operation.cs
@@ -0,0 +1,169 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// AzureBareMetal operation information
+ public partial class Operation :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal
+ {
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay _display;
+
+ /// Displayed AzureBareMetal operation information
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ internal Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Display()); set => this._display = value; }
+
+ /// The localized friendly description for the operation as shown to the user.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Description; }
+
+ /// The localized friendly name for the operation as shown to the user.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Operation; }
+
+ /// The localized friendly form of the resource provider name.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Provider; }
+
+ ///
+ /// The localized friendly form of the resource type related to this action/operation.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Inlined)]
+ public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Resource; }
+
+ /// Backing field for property.
+ private bool? _isDataAction;
+
+ /// indicates whether an operation is a data action or not.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public bool? IsDataAction { get => this._isDataAction; }
+
+ /// Internal Acessors for Display
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Display()); set { {_display = value;} } }
+
+ /// Internal Acessors for DisplayDescription
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Description = value; }
+
+ /// Internal Acessors for DisplayOperation
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Operation = value; }
+
+ /// Internal Acessors for DisplayProvider
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Provider = value; }
+
+ /// Internal Acessors for DisplayResource
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplayInternal)Display).Resource = value; }
+
+ /// Internal Acessors for IsDataAction
+ bool? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } }
+
+ /// Internal Acessors for Name
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationInternal.Name { get => this._name; set { {_name = value;} } }
+
+ /// Backing field for property.
+ private string _name;
+
+ ///
+ /// The name of the operation being performed on this particular object. This name should match the action name that appears
+ /// in RBAC / the event service.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Name { get => this._name; }
+
+ /// Creates an new instance.
+ public Operation()
+ {
+
+ }
+ }
+ /// AzureBareMetal operation information
+ public partial interface IOperation :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// The localized friendly description for the operation as shown to the user.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The localized friendly description for the operation as shown to the user.",
+ SerializedName = @"description",
+ PossibleTypes = new [] { typeof(string) })]
+ string DisplayDescription { get; }
+ /// The localized friendly name for the operation as shown to the user.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The localized friendly name for the operation as shown to the user.",
+ SerializedName = @"operation",
+ PossibleTypes = new [] { typeof(string) })]
+ string DisplayOperation { get; }
+ /// The localized friendly form of the resource provider name.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The localized friendly form of the resource provider name.",
+ SerializedName = @"provider",
+ PossibleTypes = new [] { typeof(string) })]
+ string DisplayProvider { get; }
+ ///
+ /// The localized friendly form of the resource type related to this action/operation.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The localized friendly form of the resource type related to this action/operation.",
+ SerializedName = @"resource",
+ PossibleTypes = new [] { typeof(string) })]
+ string DisplayResource { get; }
+ /// indicates whether an operation is a data action or not.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"indicates whether an operation is a data action or not.",
+ SerializedName = @"isDataAction",
+ PossibleTypes = new [] { typeof(bool) })]
+ bool? IsDataAction { get; }
+ ///
+ /// The name of the operation being performed on this particular object. This name should match the action name that appears
+ /// in RBAC / the event service.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"The name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service.",
+ SerializedName = @"name",
+ PossibleTypes = new [] { typeof(string) })]
+ string Name { get; }
+
+ }
+ /// AzureBareMetal operation information
+ internal partial interface IOperationInternal
+
+ {
+ /// Displayed AzureBareMetal operation information
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisplay Display { get; set; }
+ /// The localized friendly description for the operation as shown to the user.
+ string DisplayDescription { get; set; }
+ /// The localized friendly name for the operation as shown to the user.
+ string DisplayOperation { get; set; }
+ /// The localized friendly form of the resource provider name.
+ string DisplayProvider { get; set; }
+ ///
+ /// The localized friendly form of the resource type related to this action/operation.
+ ///
+ string DisplayResource { get; set; }
+ /// indicates whether an operation is a data action or not.
+ bool? IsDataAction { get; set; }
+ ///
+ /// The name of the operation being performed on this particular object. This name should match the action name that appears
+ /// in RBAC / the event service.
+ ///
+ string Name { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Operation.json.cs b/src/BareMetal/generated/api/Models/Api20210809/Operation.json.cs
new file mode 100644
index 000000000000..332d262fe7a4
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Operation.json.cs
@@ -0,0 +1,116 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// AzureBareMetal operation information
+ public partial class Operation
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Operation(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal Operation(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Display.FromJson(__jsonDisplay) : Display;}
+ {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;}
+ {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add );
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add );
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction" ,container.Add );
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/OperationList.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/OperationList.PowerShell.cs
new file mode 100644
index 000000000000..fd65012cc47c
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/OperationList.PowerShell.cs
@@ -0,0 +1,162 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// List of AzureBareMetal operations
+ [System.ComponentModel.TypeConverter(typeof(OperationListTypeConverter))]
+ public partial class OperationList
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new OperationList(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new OperationList(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal OperationList(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OperationTypeConverter.ConvertFrom));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal OperationList(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Value"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.OperationTypeConverter.ConvertFrom));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ /// List of AzureBareMetal operations
+ [System.ComponentModel.TypeConverter(typeof(OperationListTypeConverter))]
+ public partial interface IOperationList
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/OperationList.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/OperationList.TypeConverter.cs
new file mode 100644
index 000000000000..0609b858427c
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/OperationList.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class OperationListTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return OperationList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return OperationList.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return OperationList.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/OperationList.cs b/src/BareMetal/generated/api/Models/Api20210809/OperationList.cs
new file mode 100644
index 000000000000..4b13aa34221b
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/OperationList.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// List of AzureBareMetal operations
+ public partial class OperationList :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationListInternal
+ {
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[] _value;
+
+ /// List of AzureBareMetal operations
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[] Value { get => this._value; set => this._value = value; }
+
+ /// Creates an new instance.
+ public OperationList()
+ {
+
+ }
+ }
+ /// List of AzureBareMetal operations
+ public partial interface IOperationList :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// List of AzureBareMetal operations
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"List of AzureBareMetal operations",
+ SerializedName = @"value",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[] Value { get; set; }
+
+ }
+ /// List of AzureBareMetal operations
+ internal partial interface IOperationListInternal
+
+ {
+ /// List of AzureBareMetal operations
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation[] Value { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/OperationList.json.cs b/src/BareMetal/generated/api/Models/Api20210809/OperationList.json.cs
new file mode 100644
index 000000000000..7740bfcd55a3
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/OperationList.json.cs
@@ -0,0 +1,114 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// List of AzureBareMetal operations
+ public partial class OperationList
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new OperationList(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal OperationList(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Operation.FromJson(__u) )) ))() : null : Value;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (null != this._value)
+ {
+ var __w = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.XNodeArray();
+ foreach( var __x in this._value )
+ {
+ AddIf(__x?.ToJson(null, serializationMode) ,__w.Add);
+ }
+ container.Add("value",__w);
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Result.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/Result.PowerShell.cs
new file mode 100644
index 000000000000..c1432ace4456
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Result.PowerShell.cs
@@ -0,0 +1,162 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Sample result definition
+ [System.ComponentModel.TypeConverter(typeof(ResultTypeConverter))]
+ public partial class Result
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new Result(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new Result(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal Result(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("SampleProperty"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResultInternal)this).SampleProperty = (string) content.GetValueForProperty("SampleProperty",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResultInternal)this).SampleProperty, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal Result(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("SampleProperty"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResultInternal)this).SampleProperty = (string) content.GetValueForProperty("SampleProperty",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResultInternal)this).SampleProperty, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// Sample result definition
+ [System.ComponentModel.TypeConverter(typeof(ResultTypeConverter))]
+ public partial interface IResult
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Result.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/Result.TypeConverter.cs
new file mode 100644
index 000000000000..58d6a99c043e
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Result.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class ResultTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return Result.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return Result.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return Result.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Result.cs b/src/BareMetal/generated/api/Models/Api20210809/Result.cs
new file mode 100644
index 000000000000..57b6961572cb
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Result.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Sample result definition
+ public partial class Result :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResultInternal
+ {
+
+ /// Backing field for property.
+ private string _sampleProperty;
+
+ /// Sample property of type string
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string SampleProperty { get => this._sampleProperty; set => this._sampleProperty = value; }
+
+ /// Creates an new instance.
+ public Result()
+ {
+
+ }
+ }
+ /// Sample result definition
+ public partial interface IResult :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// Sample property of type string
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Sample property of type string",
+ SerializedName = @"sampleProperty",
+ PossibleTypes = new [] { typeof(string) })]
+ string SampleProperty { get; set; }
+
+ }
+ /// Sample result definition
+ internal partial interface IResultInternal
+
+ {
+ /// Sample property of type string
+ string SampleProperty { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Result.json.cs b/src/BareMetal/generated/api/Models/Api20210809/Result.json.cs
new file mode 100644
index 000000000000..b5073c87a2ae
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Result.json.cs
@@ -0,0 +1,106 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Sample result definition
+ public partial class Result
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Result(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal Result(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_sampleProperty = If( json?.PropertyT("sampleProperty"), out var __jsonSampleProperty) ? (string)__jsonSampleProperty : (string)SampleProperty;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != (((object)this._sampleProperty)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._sampleProperty.ToString()) : null, "sampleProperty" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.PowerShell.cs
new file mode 100644
index 000000000000..9aead2db5782
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.PowerShell.cs
@@ -0,0 +1,170 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Specifies the storage settings for the AzureBareMetal instance disks.
+ [System.ComponentModel.TypeConverter(typeof(StorageProfileTypeConverter))]
+ public partial class StorageProfile
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new StorageProfile(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new StorageProfile(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal StorageProfile(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("NfsIPAddress"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).NfsIPAddress = (string) content.GetValueForProperty("NfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).NfsIPAddress, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSDisk"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).OSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("OSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).OSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom));
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal StorageProfile(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("NfsIPAddress"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).NfsIPAddress = (string) content.GetValueForProperty("NfsIPAddress",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).NfsIPAddress, global::System.Convert.ToString);
+ }
+ if (content.Contains("OSDisk"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).OSDisk = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[]) content.GetValueForProperty("OSDisk",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal)this).OSDisk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.DiskTypeConverter.ConvertFrom));
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// Specifies the storage settings for the AzureBareMetal instance disks.
+ [System.ComponentModel.TypeConverter(typeof(StorageProfileTypeConverter))]
+ public partial interface IStorageProfile
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.TypeConverter.cs
new file mode 100644
index 000000000000..da842c171f65
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class StorageProfileTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return StorageProfile.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return StorageProfile.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return StorageProfile.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.cs b/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.cs
new file mode 100644
index 000000000000..305b7ea19fd2
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.cs
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the storage settings for the AzureBareMetal instance disks.
+ public partial class StorageProfile :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal
+ {
+
+ /// Internal Acessors for NfsIPAddress
+ string Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfileInternal.NfsIPAddress { get => this._nfsIPAddress; set { {_nfsIPAddress = value;} } }
+
+ /// Backing field for property.
+ private string _nfsIPAddress;
+
+ /// IP Address to connect to storage.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string NfsIPAddress { get => this._nfsIPAddress; }
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] _oSDisk;
+
+ ///
+ /// Specifies information about the operating system disk used by baremetal instance.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] OSDisk { get => this._oSDisk; set => this._oSDisk = value; }
+
+ /// Creates an new instance.
+ public StorageProfile()
+ {
+
+ }
+ }
+ /// Specifies the storage settings for the AzureBareMetal instance disks.
+ public partial interface IStorageProfile :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// IP Address to connect to storage.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = true,
+ Description = @"IP Address to connect to storage.",
+ SerializedName = @"nfsIpAddress",
+ PossibleTypes = new [] { typeof(string) })]
+ string NfsIPAddress { get; }
+ ///
+ /// Specifies information about the operating system disk used by baremetal instance.
+ ///
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Specifies information about the operating system disk used by baremetal instance.",
+ SerializedName = @"osDisks",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] OSDisk { get; set; }
+
+ }
+ /// Specifies the storage settings for the AzureBareMetal instance disks.
+ internal partial interface IStorageProfileInternal
+
+ {
+ /// IP Address to connect to storage.
+ string NfsIPAddress { get; set; }
+ ///
+ /// Specifies information about the operating system disk used by baremetal instance.
+ ///
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IDisk[] OSDisk { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.json.cs b/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.json.cs
new file mode 100644
index 000000000000..64709a194c4a
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/StorageProfile.json.cs
@@ -0,0 +1,119 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Specifies the storage settings for the AzureBareMetal instance disks.
+ public partial class StorageProfile
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IStorageProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new StorageProfile(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal StorageProfile(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_nfsIPAddress = If( json?.PropertyT("nfsIpAddress"), out var __jsonNfsIPAddress) ? (string)__jsonNfsIPAddress : (string)NfsIPAddress;}
+ {_oSDisk = If( json?.PropertyT("osDisks"), out var __jsonOSDisks) ? If( __jsonOSDisks as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Models.Api20210809.IDisk) (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Disk.FromJson(__u) )) ))() : null : OSDisk;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode.IncludeReadOnly))
+ {
+ AddIf( null != (((object)this._nfsIPAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._nfsIPAddress.ToString()) : null, "nfsIpAddress" ,container.Add );
+ }
+ if (null != this._oSDisk)
+ {
+ var __w = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.XNodeArray();
+ foreach( var __x in this._oSDisk )
+ {
+ AddIf(__x?.ToJson(null, serializationMode) ,__w.Add);
+ }
+ container.Add("osDisks",__w);
+ }
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Tags.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/Tags.PowerShell.cs
new file mode 100644
index 000000000000..c04de3cd0545
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Tags.PowerShell.cs
@@ -0,0 +1,158 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Tags field of the AzureBareMetal instance.
+ [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))]
+ public partial class Tags
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new Tags(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new Tags(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal Tags(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ // this type is a dictionary; copy elements from source to here.
+ CopyFrom(content);
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal Tags(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ // this type is a dictionary; copy elements from source to here.
+ CopyFrom(content);
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// Tags field of the AzureBareMetal instance.
+ [System.ComponentModel.TypeConverter(typeof(TagsTypeConverter))]
+ public partial interface ITags
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Tags.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/Tags.TypeConverter.cs
new file mode 100644
index 000000000000..faac560319d7
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Tags.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class TagsTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return Tags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return Tags.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return Tags.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Tags.cs b/src/BareMetal/generated/api/Models/Api20210809/Tags.cs
new file mode 100644
index 000000000000..1cf5b9c7b8aa
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Tags.cs
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Tags field of the AzureBareMetal instance.
+ public partial class Tags :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITagsInternal
+ {
+
+ /// Creates an new instance.
+ public Tags()
+ {
+
+ }
+ }
+ /// Tags field of the AzureBareMetal instance.
+ public partial interface ITags :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray
+ {
+
+ }
+ /// Tags field of the AzureBareMetal instance.
+ internal partial interface ITagsInternal
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Tags.dictionary.cs b/src/BareMetal/generated/api/Models/Api20210809/Tags.dictionary.cs
new file mode 100644
index 000000000000..88058f7ad21d
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Tags.dictionary.cs
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ public partial class Tags :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray
+ {
+ protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary();
+
+ global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; }
+
+ int Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; }
+
+ global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; }
+
+ global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; }
+
+ public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; }
+
+ ///
+ ///
+ public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value);
+
+ public void Clear() => __additionalProperties.Clear();
+
+ ///
+ public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key);
+
+ ///
+ public void CopyFrom(global::System.Collections.IDictionary source)
+ {
+ if (null != source)
+ {
+ foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) )
+ {
+ if ((null != property.Key && null != property.Value))
+ {
+ this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value));
+ }
+ }
+ }
+ }
+
+ ///
+ public void CopyFrom(global::System.Management.Automation.PSObject source)
+ {
+ if (null != source)
+ {
+ foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) )
+ {
+ if ((null != property.Key && null != property.Value))
+ {
+ this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value));
+ }
+ }
+ }
+ }
+
+ ///
+ public bool Remove(global::System.String key) => __additionalProperties.Remove( key);
+
+ ///
+ ///
+ public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value);
+
+ ///
+
+ public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags source) => source.__additionalProperties;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Tags.json.cs b/src/BareMetal/generated/api/Models/Api20210809/Tags.json.cs
new file mode 100644
index 000000000000..1882bdeb8508
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Tags.json.cs
@@ -0,0 +1,107 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Tags field of the AzureBareMetal instance.
+ public partial class Tags
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Tags(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ ///
+ internal Tags(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions );
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IAssociativeArray)this).AdditionalProperties, container);
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Tags1.PowerShell.cs b/src/BareMetal/generated/api/Models/Api20210809/Tags1.PowerShell.cs
new file mode 100644
index 000000000000..2c99f960f5c7
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Tags1.PowerShell.cs
@@ -0,0 +1,162 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ /// Tags field of the AzureBareMetal instance.
+ [System.ComponentModel.TypeConverter(typeof(Tags1TypeConverter))]
+ public partial class Tags1
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);
+
+ ///
+ /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior
+ ///
+ /// /// instance serialized to a string, normally it is a Json
+ /// /// set returnNow to true if you provide a customized OverrideToString function
+
+ partial void OverrideToString(ref string stringResult, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new Tags1(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new Tags1(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(jsonText));
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ internal Tags1(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Tag"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.TagsTypeConverter.ConvertFrom);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal Tags1(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("Tag"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1Internal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1Internal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.TagsTypeConverter.ConvertFrom);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ /// Serializes this instance to a json string.
+
+ /// a containing this model serialized to JSON text.
+ public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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();
+ }
+ }
+ /// Tags field of the AzureBareMetal instance.
+ [System.ComponentModel.TypeConverter(typeof(Tags1TypeConverter))]
+ public partial interface ITags1
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Tags1.TypeConverter.cs b/src/BareMetal/generated/api/Models/Api20210809/Tags1.TypeConverter.cs
new file mode 100644
index 000000000000..477b35daa9c0
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Tags1.TypeConverter.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class Tags1TypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return Tags1.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return Tags1.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return Tags1.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Tags1.cs b/src/BareMetal/generated/api/Models/Api20210809/Tags1.cs
new file mode 100644
index 000000000000..cd1832d817d4
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Tags1.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Tags field of the AzureBareMetal instance.
+ public partial class Tags1 :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1Internal
+ {
+
+ /// Backing field for property.
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags _tag;
+
+ /// Tags field of the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags()); set => this._tag = value; }
+
+ /// Creates an new instance.
+ public Tags1()
+ {
+
+ }
+ }
+ /// Tags field of the AzureBareMetal instance.
+ public partial interface ITags1 :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// Tags field of the AzureBareMetal instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Tags field of the AzureBareMetal instance.",
+ SerializedName = @"tags",
+ PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags) })]
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags Tag { get; set; }
+
+ }
+ /// Tags field of the AzureBareMetal instance.
+ internal partial interface ITags1Internal
+
+ {
+ /// Tags field of the AzureBareMetal instance.
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags Tag { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/Api20210809/Tags1.json.cs b/src/BareMetal/generated/api/Models/Api20210809/Tags1.json.cs
new file mode 100644
index 000000000000..8b3e8f8cb2d8
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/Api20210809/Tags1.json.cs
@@ -0,0 +1,106 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ /// Tags field of the AzureBareMetal instance.
+ public partial class Tags1
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.ITags1 FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new Tags1(json) : null;
+ }
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal Tags1(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.Tags.FromJson(__jsonTags) : Tag;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/BareMetalIdentity.PowerShell.cs b/src/BareMetal/generated/api/Models/BareMetalIdentity.PowerShell.cs
new file mode 100644
index 000000000000..9eca5197cc5a
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/BareMetalIdentity.PowerShell.cs
@@ -0,0 +1,184 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ [System.ComponentModel.TypeConverter(typeof(BareMetalIdentityTypeConverter))]
+ public partial class BareMetalIdentity
+ {
+
+ ///
+ /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the
+ /// object before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+
+ partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);
+
+ ///
+ /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+
+ partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);
+
+ ///
+ /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);
+
+ ///
+ /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization
+ /// of the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ /// Determines if the rest of 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 BareMetalIdentity(global::System.Collections.IDictionary content)
+ {
+ bool returnNow = false;
+ BeforeDeserializeDictionary(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("SubscriptionId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).SubscriptionId, global::System.Convert.ToString);
+ }
+ if (content.Contains("ResourceGroupName"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString);
+ }
+ if (content.Contains("AzureBareMetalInstanceName"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).AzureBareMetalInstanceName = (string) content.GetValueForProperty("AzureBareMetalInstanceName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).AzureBareMetalInstanceName, global::System.Convert.ToString);
+ }
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).Id, global::System.Convert.ToString);
+ }
+ AfterDeserializeDictionary(content);
+ }
+
+ ///
+ /// Deserializes a into a new instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ internal BareMetalIdentity(global::System.Management.Automation.PSObject content)
+ {
+ bool returnNow = false;
+ BeforeDeserializePSObject(content, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ // actually deserialize
+ if (content.Contains("SubscriptionId"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).SubscriptionId, global::System.Convert.ToString);
+ }
+ if (content.Contains("ResourceGroupName"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString);
+ }
+ if (content.Contains("AzureBareMetalInstanceName"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).AzureBareMetalInstanceName = (string) content.GetValueForProperty("AzureBareMetalInstanceName",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).AzureBareMetalInstanceName, global::System.Convert.ToString);
+ }
+ if (content.Contains("Id"))
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal)this).Id, global::System.Convert.ToString);
+ }
+ AfterDeserializePSObject(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Collections.IDictionary content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content)
+ {
+ return new BareMetalIdentity(content);
+ }
+
+ ///
+ /// Deserializes a into an instance of .
+ ///
+ /// The global::System.Management.Automation.PSObject content that should be used.
+ ///
+ /// an instance of .
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
+ {
+ return new BareMetalIdentity(content);
+ }
+
+ ///
+ /// Creates a new instance of , deserializing the content from a json string.
+ ///
+ /// a string containing a JSON serialized instance of this model.
+ /// an instance of the model class.
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.SerializationMode.IncludeAll)?.ToString();
+
+ public override string ToString()
+ {
+ var returnNow = false;
+ var result = global::System.String.Empty;
+ OverrideToString(ref result, ref returnNow);
+ if (returnNow)
+ {
+ return result;
+ }
+ return ToJsonString();
+ }
+ }
+ [System.ComponentModel.TypeConverter(typeof(BareMetalIdentityTypeConverter))]
+ public partial interface IBareMetalIdentity
+
+ {
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/BareMetalIdentity.TypeConverter.cs b/src/BareMetal/generated/api/Models/BareMetalIdentity.TypeConverter.cs
new file mode 100644
index 000000000000..f205bcf5ab90
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/BareMetalIdentity.TypeConverter.cs
@@ -0,0 +1,157 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models
+{
+ using Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell;
+
+ ///
+ /// A PowerShell PSTypeConverter to support converting to an instance of
+ ///
+ public partial class BareMetalIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false.
+ ///
+ public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue);
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the instance to check if it can be converted to the type.
+ ///
+ /// true if the instance could be converted to a type, otherwise false
+ ///
+ public static bool CanConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return true;
+ }
+ global::System.Type type = sourceValue.GetType();
+ // we allow string conversion too.
+ if (type == typeof(global::System.String))
+ {
+ return true;
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ // we say yest to PSObjects
+ return true;
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ // we say yest to Hashtables/dictionaries
+ return true;
+ }
+ try
+ {
+ if (null != sourceValue.ToJsonString())
+ {
+ return true;
+ }
+ }
+ catch
+ {
+ // Not one of our objects
+ }
+ try
+ {
+ string text = sourceValue.ToString()?.Trim();
+ return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonType.Object;
+ }
+ catch
+ {
+ // Doesn't look like it can be treated as JSON
+ }
+ return false;
+ }
+
+ ///
+ /// Determines if the parameter can be converted to the parameter
+ ///
+ /// the to convert from
+ /// the to convert to
+ ///
+ /// true if the converter can convert the parameter to the
+ /// parameter, otherwise false
+ ///
+ public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false;
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue);
+
+ ///
+ /// Converts the parameter to the parameter using and
+ ///
+ /// the value to convert into an instance of .
+ ///
+ /// an instance of , or null if there is no suitable conversion.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity ConvertFrom(dynamic sourceValue)
+ {
+ if (null == sourceValue)
+ {
+ return null;
+ }
+ global::System.Type type = sourceValue.GetType();
+ // support direct string to id type conversion.
+ if (type == typeof(global::System.String))
+ {
+ return new BareMetalIdentity { Id = sourceValue };
+ }
+ if (typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity).IsAssignableFrom(type))
+ {
+ return sourceValue;
+ }
+ try
+ {
+ return BareMetalIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());;
+ }
+ catch
+ {
+ // Unable to use JSON pattern
+ }
+ if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type))
+ {
+ return BareMetalIdentity.DeserializeFromPSObject(sourceValue);
+ }
+ if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type))
+ {
+ return BareMetalIdentity.DeserializeFromDictionary(sourceValue);
+ }
+ return null;
+ }
+
+ /// NotImplemented -- this will return null
+ /// the to convert from
+ /// the to convert to
+ /// not used by this TypeConverter.
+ /// when set to true, will ignore the case when converting.
+ /// will always return null.
+ public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null;
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/BareMetalIdentity.cs b/src/BareMetal/generated/api/Models/BareMetalIdentity.cs
new file mode 100644
index 000000000000..1b9142fb620c
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/BareMetalIdentity.cs
@@ -0,0 +1,99 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ public partial class BareMetalIdentity :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentityInternal
+ {
+
+ /// Backing field for property.
+ private string _azureBareMetalInstanceName;
+
+ /// Name of the Azure BareMetal on Azure instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string AzureBareMetalInstanceName { get => this._azureBareMetalInstanceName; set => this._azureBareMetalInstanceName = value; }
+
+ /// Backing field for property.
+ private string _id;
+
+ /// Resource identity path
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string Id { get => this._id; set => this._id = value; }
+
+ /// Backing field for property.
+ private string _resourceGroupName;
+
+ /// The name of the resource group. The name is case insensitive.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; }
+
+ /// Backing field for property.
+ private string _subscriptionId;
+
+ /// The ID of the target subscription.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Origin(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.PropertyOrigin.Owned)]
+ public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; }
+
+ /// Creates an new instance.
+ public BareMetalIdentity()
+ {
+
+ }
+ }
+ public partial interface IBareMetalIdentity :
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IJsonSerializable
+ {
+ /// Name of the Azure BareMetal on Azure instance.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Name of the Azure BareMetal on Azure instance.",
+ SerializedName = @"azureBareMetalInstanceName",
+ PossibleTypes = new [] { typeof(string) })]
+ string AzureBareMetalInstanceName { get; set; }
+ /// Resource identity path
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"Resource identity path",
+ SerializedName = @"id",
+ PossibleTypes = new [] { typeof(string) })]
+ string Id { get; set; }
+ /// The name of the resource group. The name is case insensitive.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The name of the resource group. The name is case insensitive.",
+ SerializedName = @"resourceGroupName",
+ PossibleTypes = new [] { typeof(string) })]
+ string ResourceGroupName { get; set; }
+ /// The ID of the target subscription.
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = false,
+ ReadOnly = false,
+ Description = @"The ID of the target subscription.",
+ SerializedName = @"subscriptionId",
+ PossibleTypes = new [] { typeof(string) })]
+ string SubscriptionId { get; set; }
+
+ }
+ internal partial interface IBareMetalIdentityInternal
+
+ {
+ /// Name of the Azure BareMetal on Azure instance.
+ string AzureBareMetalInstanceName { get; set; }
+ /// Resource identity path
+ string Id { get; set; }
+ /// The name of the resource group. The name is case insensitive.
+ string ResourceGroupName { get; set; }
+ /// The ID of the target subscription.
+ string SubscriptionId { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Models/BareMetalIdentity.json.cs b/src/BareMetal/generated/api/Models/BareMetalIdentity.json.cs
new file mode 100644
index 000000000000..0e2f7e95554b
--- /dev/null
+++ b/src/BareMetal/generated/api/Models/BareMetalIdentity.json.cs
@@ -0,0 +1,111 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+
+ public partial class BareMetalIdentity
+ {
+
+ ///
+ /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object
+ /// before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JsonNode that should be deserialized into this object.
+
+ partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json);
+
+ ///
+ /// AfterToJson will be called after the json erialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior
+ ///
+ /// The JSON container that the serialization result will be placed in.
+
+ partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container);
+
+ ///
+ /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of
+ /// the object before it is deserialized.
+ /// If you wish to disable the default deserialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JsonNode that should be deserialized into this object.
+ /// Determines if the rest of the deserialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json, ref bool returnNow);
+
+ ///
+ /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the
+ /// object before it is serialized.
+ /// If you wish to disable the default serialization entirely, return true in the output parameter.
+ /// Implement this method in a partial class to enable this behavior.
+ ///
+ /// The JSON container that the serialization result will be placed in.
+ /// Determines if the rest of the serialization should be processed, or if the method should return
+ /// instantly.
+
+ partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, ref bool returnNow);
+
+ ///
+ /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject into a new instance of .
+ ///
+ /// A Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject instance to deserialize from.
+ internal BareMetalIdentity(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json)
+ {
+ bool returnNow = false;
+ BeforeFromJson(json, ref returnNow);
+ if (returnNow)
+ {
+ return;
+ }
+ {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;}
+ {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;}
+ {_azureBareMetalInstanceName = If( json?.PropertyT("azureBareMetalInstanceName"), out var __jsonAzureBareMetalInstanceName) ? (string)__jsonAzureBareMetalInstanceName : (string)AzureBareMetalInstanceName;}
+ {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;}
+ AfterFromJson(json);
+ }
+
+ ///
+ /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity.
+ ///
+ /// a to deserialize from.
+ ///
+ /// an instance of Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity.
+ ///
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.IBareMetalIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode node)
+ {
+ return node is Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject json ? new BareMetalIdentity(json) : null;
+ }
+
+ ///
+ /// Serializes this instance of into a .
+ ///
+ /// The container to serialize this object into. If the caller
+ /// passes in null, a new instance will be created and returned to the caller.
+ /// Allows the caller to choose the depth of the serialization. See .
+ ///
+ /// a serialized instance of as a .
+ ///
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.SerializationMode serializationMode)
+ {
+ container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonObject();
+
+ bool returnNow = false;
+ BeforeToJson(ref container, ref returnNow);
+ if (returnNow)
+ {
+ return container;
+ }
+ AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add );
+ AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add );
+ AddIf( null != (((object)this._azureBareMetalInstanceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._azureBareMetalInstanceName.ToString()) : null, "azureBareMetalInstanceName" ,container.Add );
+ AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add );
+ AfterToJson(ref container);
+ return container;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.Completer.cs b/src/BareMetal/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.Completer.cs
new file mode 100644
index 000000000000..708b2f2e1db8
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.Completer.cs
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// Name of the hardware type (vendor and/or their product name)
+ [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnumTypeConverter))]
+ public partial struct AzureBareMetalHardwareTypeNamesEnum :
+ 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) || "Cisco_UCS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'Cisco_UCS'", "Cisco_UCS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cisco_UCS");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "HPE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'HPE'", "HPE", global::System.Management.Automation.CompletionResultType.ParameterValue, "HPE");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.TypeConverter.cs b/src/BareMetal/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.TypeConverter.cs
new file mode 100644
index 000000000000..3373a51bf2c9
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.TypeConverter.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// Name of the hardware type (vendor and/or their product name)
+ public partial class AzureBareMetalHardwareTypeNamesEnumTypeConverter :
+ global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert 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) => AzureBareMetalHardwareTypeNamesEnum.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/src/BareMetal/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.cs b/src/BareMetal/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.cs
new file mode 100644
index 000000000000..d849c14eae58
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalHardwareTypeNamesEnum.cs
@@ -0,0 +1,104 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// Name of the hardware type (vendor and/or their product name)
+ public partial struct AzureBareMetalHardwareTypeNamesEnum :
+ System.IEquatable
+ {
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum CiscoUcs = @"Cisco_UCS";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum Hpe = @"HPE";
+
+ ///
+ /// the value for an instance of the Enum.
+ ///
+ private string _value { get; set; }
+
+ ///
+ /// Creates an instance of the
+ ///
+ /// the value to create an instance for.
+ private AzureBareMetalHardwareTypeNamesEnum(string underlyingValue)
+ {
+ this._value = underlyingValue;
+ }
+
+ /// Conversion from arbitrary object to AzureBareMetalHardwareTypeNamesEnum
+ /// the value to convert to an instance of .
+ internal static object CreateFrom(object value)
+ {
+ return new AzureBareMetalHardwareTypeNamesEnum(global::System.Convert.ToString(value));
+ }
+
+ /// Compares values of enum type AzureBareMetalHardwareTypeNamesEnum
+ /// 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.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e)
+ {
+ return _value.Equals(e._value);
+ }
+
+ ///
+ /// Compares values of enum type AzureBareMetalHardwareTypeNamesEnum (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 AzureBareMetalHardwareTypeNamesEnum && Equals((AzureBareMetalHardwareTypeNamesEnum)obj);
+ }
+
+ /// Returns hashCode for enum AzureBareMetalHardwareTypeNamesEnum
+ /// The hashCode of the value
+ public override int GetHashCode()
+ {
+ return this._value.GetHashCode();
+ }
+
+ /// Returns string representation for AzureBareMetalHardwareTypeNamesEnum
+ /// A string for this value.
+ public override string ToString()
+ {
+ return this._value;
+ }
+
+ /// Implicit operator to convert string to AzureBareMetalHardwareTypeNamesEnum
+ /// the value to convert to an instance of .
+
+ public static implicit operator AzureBareMetalHardwareTypeNamesEnum(string value)
+ {
+ return new AzureBareMetalHardwareTypeNamesEnum(value);
+ }
+
+ /// Implicit operator to convert AzureBareMetalHardwareTypeNamesEnum to string
+ /// the value to convert to an instance of .
+
+ public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e)
+ {
+ return e._value;
+ }
+
+ /// Overriding != operator for enum AzureBareMetalHardwareTypeNamesEnum
+ /// 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.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e2)
+ {
+ return !e2.Equals(e1);
+ }
+
+ /// Overriding == operator for enum AzureBareMetalHardwareTypeNamesEnum
+ /// 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.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalHardwareTypeNamesEnum e2)
+ {
+ return e2.Equals(e1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Support/AzureBareMetalInstancePowerStateEnum.Completer.cs b/src/BareMetal/generated/api/Support/AzureBareMetalInstancePowerStateEnum.Completer.cs
new file mode 100644
index 000000000000..204c4318224a
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalInstancePowerStateEnum.Completer.cs
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// Resource power state
+ [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnumTypeConverter))]
+ public partial struct AzureBareMetalInstancePowerStateEnum :
+ 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) || "starting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'starting'", "starting", global::System.Management.Automation.CompletionResultType.ParameterValue, "starting");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "started".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'started'", "started", global::System.Management.Automation.CompletionResultType.ParameterValue, "started");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "stopping".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'stopping'", "stopping", global::System.Management.Automation.CompletionResultType.ParameterValue, "stopping");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "stopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'stopped'", "stopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "stopped");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "restarting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'restarting'", "restarting", global::System.Management.Automation.CompletionResultType.ParameterValue, "restarting");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'unknown'", "unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "unknown");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Support/AzureBareMetalInstancePowerStateEnum.TypeConverter.cs b/src/BareMetal/generated/api/Support/AzureBareMetalInstancePowerStateEnum.TypeConverter.cs
new file mode 100644
index 000000000000..8bca258d6c6c
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalInstancePowerStateEnum.TypeConverter.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// Resource power state
+ public partial class AzureBareMetalInstancePowerStateEnumTypeConverter :
+ global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert 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) => AzureBareMetalInstancePowerStateEnum.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/src/BareMetal/generated/api/Support/AzureBareMetalInstancePowerStateEnum.cs b/src/BareMetal/generated/api/Support/AzureBareMetalInstancePowerStateEnum.cs
new file mode 100644
index 000000000000..a1d2525f0ee5
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalInstancePowerStateEnum.cs
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// Resource power state
+ public partial struct AzureBareMetalInstancePowerStateEnum :
+ System.IEquatable
+ {
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Restarting = @"restarting";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Started = @"started";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Starting = @"starting";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Stopped = @"stopped";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Stopping = @"stopping";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum Unknown = @"unknown";
+
+ ///
+ /// the value for an instance of the Enum.
+ ///
+ private string _value { get; set; }
+
+ ///
+ /// Creates an instance of the
+ ///
+ /// the value to create an instance for.
+ private AzureBareMetalInstancePowerStateEnum(string underlyingValue)
+ {
+ this._value = underlyingValue;
+ }
+
+ /// Conversion from arbitrary object to AzureBareMetalInstancePowerStateEnum
+ /// the value to convert to an instance of .
+ internal static object CreateFrom(object value)
+ {
+ return new AzureBareMetalInstancePowerStateEnum(global::System.Convert.ToString(value));
+ }
+
+ /// Compares values of enum type AzureBareMetalInstancePowerStateEnum
+ /// 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.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e)
+ {
+ return _value.Equals(e._value);
+ }
+
+ ///
+ /// Compares values of enum type AzureBareMetalInstancePowerStateEnum (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 AzureBareMetalInstancePowerStateEnum && Equals((AzureBareMetalInstancePowerStateEnum)obj);
+ }
+
+ /// Returns hashCode for enum AzureBareMetalInstancePowerStateEnum
+ /// The hashCode of the value
+ public override int GetHashCode()
+ {
+ return this._value.GetHashCode();
+ }
+
+ /// Returns string representation for AzureBareMetalInstancePowerStateEnum
+ /// A string for this value.
+ public override string ToString()
+ {
+ return this._value;
+ }
+
+ /// Implicit operator to convert string to AzureBareMetalInstancePowerStateEnum
+ /// the value to convert to an instance of .
+
+ public static implicit operator AzureBareMetalInstancePowerStateEnum(string value)
+ {
+ return new AzureBareMetalInstancePowerStateEnum(value);
+ }
+
+ /// Implicit operator to convert AzureBareMetalInstancePowerStateEnum to string
+ /// the value to convert to an instance of .
+
+ public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e)
+ {
+ return e._value;
+ }
+
+ /// Overriding != operator for enum AzureBareMetalInstancePowerStateEnum
+ /// 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.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e2)
+ {
+ return !e2.Equals(e1);
+ }
+
+ /// Overriding == operator for enum AzureBareMetalInstancePowerStateEnum
+ /// 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.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstancePowerStateEnum e2)
+ {
+ return e2.Equals(e1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.Completer.cs b/src/BareMetal/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.Completer.cs
new file mode 100644
index 000000000000..fff400cedc66
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.Completer.cs
@@ -0,0 +1,203 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// Specifies the AzureBareMetal instance SKU.
+ [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnumTypeConverter))]
+ public partial struct AzureBareMetalInstanceSizeNamesEnum :
+ 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) || "S72m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S72m'", "S72m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S72m");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S144m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S144m'", "S144m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S144m");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S72".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S72'", "S72", global::System.Management.Automation.CompletionResultType.ParameterValue, "S72");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S144".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S144'", "S144", global::System.Management.Automation.CompletionResultType.ParameterValue, "S144");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S192".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S192'", "S192", global::System.Management.Automation.CompletionResultType.ParameterValue, "S192");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S192m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S192m'", "S192m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S192m");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S192xm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S192xm'", "S192xm", global::System.Management.Automation.CompletionResultType.ParameterValue, "S192xm");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S96".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S96'", "S96", global::System.Management.Automation.CompletionResultType.ParameterValue, "S96");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S112".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S112'", "S112", global::System.Management.Automation.CompletionResultType.ParameterValue, "S112");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S224'", "S224", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S224m'", "S224m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224m");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224om".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S224om'", "S224om", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224om");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224oo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S224oo'", "S224oo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224oo");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224oom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S224oom'", "S224oom", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224oom");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S224ooo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S224ooo'", "S224ooo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S224ooo");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S384".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S384'", "S384", global::System.Management.Automation.CompletionResultType.ParameterValue, "S384");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S384m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S384m'", "S384m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S384m");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S384xm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S384xm'", "S384xm", global::System.Management.Automation.CompletionResultType.ParameterValue, "S384xm");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S384xxm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S384xxm'", "S384xxm", global::System.Management.Automation.CompletionResultType.ParameterValue, "S384xxm");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S448'", "S448", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S448m'", "S448m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448m");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448om".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S448om'", "S448om", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448om");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448oo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S448oo'", "S448oo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448oo");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448oom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S448oom'", "S448oom", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448oom");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S448ooo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S448ooo'", "S448ooo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S448ooo");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S576m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S576m'", "S576m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S576m");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S576xm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S576xm'", "S576xm", global::System.Management.Automation.CompletionResultType.ParameterValue, "S576xm");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S672'", "S672", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S672m'", "S672m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672m");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672om".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S672om'", "S672om", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672om");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672oo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S672oo'", "S672oo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672oo");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672oom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S672oom'", "S672oom", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672oom");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S672ooo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S672ooo'", "S672ooo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S672ooo");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S768".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S768'", "S768", global::System.Management.Automation.CompletionResultType.ParameterValue, "S768");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S768m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S768m'", "S768m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S768m");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S768xm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S768xm'", "S768xm", global::System.Management.Automation.CompletionResultType.ParameterValue, "S768xm");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S896'", "S896", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S896m'", "S896m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896m");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896om".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S896om'", "S896om", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896om");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896oo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S896oo'", "S896oo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896oo");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896oom".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S896oom'", "S896oom", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896oom");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S896ooo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S896ooo'", "S896ooo", global::System.Management.Automation.CompletionResultType.ParameterValue, "S896ooo");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "S960m".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'S960m'", "S960m", global::System.Management.Automation.CompletionResultType.ParameterValue, "S960m");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.TypeConverter.cs b/src/BareMetal/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.TypeConverter.cs
new file mode 100644
index 000000000000..2a1d15ab038e
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.TypeConverter.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// Specifies the AzureBareMetal instance SKU.
+ public partial class AzureBareMetalInstanceSizeNamesEnumTypeConverter :
+ global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert 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) => AzureBareMetalInstanceSizeNamesEnum.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/src/BareMetal/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.cs b/src/BareMetal/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.cs
new file mode 100644
index 000000000000..9232306438b1
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalInstanceSizeNamesEnum.cs
@@ -0,0 +1,186 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// Specifies the AzureBareMetal instance SKU.
+ public partial struct AzureBareMetalInstanceSizeNamesEnum :
+ System.IEquatable
+ {
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S112 = @"S112";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S144 = @"S144";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S144M = @"S144m";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S192 = @"S192";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S192M = @"S192m";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S192Xm = @"S192xm";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224 = @"S224";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224M = @"S224m";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224Om = @"S224om";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224Oo = @"S224oo";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224Oom = @"S224oom";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S224Ooo = @"S224ooo";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S384 = @"S384";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S384M = @"S384m";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S384Xm = @"S384xm";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S384Xxm = @"S384xxm";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448 = @"S448";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448M = @"S448m";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448Om = @"S448om";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448Oo = @"S448oo";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448Oom = @"S448oom";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S448Ooo = @"S448ooo";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S576M = @"S576m";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S576Xm = @"S576xm";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672 = @"S672";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672M = @"S672m";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672Om = @"S672om";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672Oo = @"S672oo";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672Oom = @"S672oom";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S672Ooo = @"S672ooo";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S72 = @"S72";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S72M = @"S72m";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S768 = @"S768";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S768M = @"S768m";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S768Xm = @"S768xm";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896 = @"S896";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896M = @"S896m";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896Om = @"S896om";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896Oo = @"S896oo";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896Oom = @"S896oom";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S896Ooo = @"S896ooo";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S96 = @"S96";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum S960M = @"S960m";
+
+ ///
+ /// the value for an instance of the Enum.
+ ///
+ private string _value { get; set; }
+
+ ///
+ /// Creates an instance of the
+ ///
+ /// the value to create an instance for.
+ private AzureBareMetalInstanceSizeNamesEnum(string underlyingValue)
+ {
+ this._value = underlyingValue;
+ }
+
+ /// Conversion from arbitrary object to AzureBareMetalInstanceSizeNamesEnum
+ /// the value to convert to an instance of .
+ internal static object CreateFrom(object value)
+ {
+ return new AzureBareMetalInstanceSizeNamesEnum(global::System.Convert.ToString(value));
+ }
+
+ /// Compares values of enum type AzureBareMetalInstanceSizeNamesEnum
+ /// 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.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e)
+ {
+ return _value.Equals(e._value);
+ }
+
+ ///
+ /// Compares values of enum type AzureBareMetalInstanceSizeNamesEnum (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 AzureBareMetalInstanceSizeNamesEnum && Equals((AzureBareMetalInstanceSizeNamesEnum)obj);
+ }
+
+ /// Returns hashCode for enum AzureBareMetalInstanceSizeNamesEnum
+ /// The hashCode of the value
+ public override int GetHashCode()
+ {
+ return this._value.GetHashCode();
+ }
+
+ /// Returns string representation for AzureBareMetalInstanceSizeNamesEnum
+ /// A string for this value.
+ public override string ToString()
+ {
+ return this._value;
+ }
+
+ /// Implicit operator to convert string to AzureBareMetalInstanceSizeNamesEnum
+ /// the value to convert to an instance of .
+
+ public static implicit operator AzureBareMetalInstanceSizeNamesEnum(string value)
+ {
+ return new AzureBareMetalInstanceSizeNamesEnum(value);
+ }
+
+ /// Implicit operator to convert AzureBareMetalInstanceSizeNamesEnum to string
+ /// the value to convert to an instance of .
+
+ public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e)
+ {
+ return e._value;
+ }
+
+ /// Overriding != operator for enum AzureBareMetalInstanceSizeNamesEnum
+ /// 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.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e2)
+ {
+ return !e2.Equals(e1);
+ }
+
+ /// Overriding == operator for enum AzureBareMetalInstanceSizeNamesEnum
+ /// 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.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalInstanceSizeNamesEnum e2)
+ {
+ return e2.Equals(e1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Support/AzureBareMetalProvisioningStatesEnum.Completer.cs b/src/BareMetal/generated/api/Support/AzureBareMetalProvisioningStatesEnum.Completer.cs
new file mode 100644
index 000000000000..998726d59ac4
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalProvisioningStatesEnum.Completer.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// State of provisioning of the AzureBareMetalInstance
+ [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnumTypeConverter))]
+ public partial struct AzureBareMetalProvisioningStatesEnum :
+ 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) || "Accepted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'Accepted'", "Accepted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accepted");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting");
+ }
+ if (global::System.String.IsNullOrEmpty(wordToComplete) || "Migrating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase))
+ {
+ yield return new global::System.Management.Automation.CompletionResult("'Migrating'", "Migrating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Migrating");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Support/AzureBareMetalProvisioningStatesEnum.TypeConverter.cs b/src/BareMetal/generated/api/Support/AzureBareMetalProvisioningStatesEnum.TypeConverter.cs
new file mode 100644
index 000000000000..b6bdad5ec37a
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalProvisioningStatesEnum.TypeConverter.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// State of provisioning of the AzureBareMetalInstance
+ public partial class AzureBareMetalProvisioningStatesEnumTypeConverter :
+ global::System.Management.Automation.PSTypeConverter
+ {
+
+ ///
+ /// Determines if the converter can convert the parameter to the
+ /// parameter.
+ ///
+ /// the to convert from
+ /// the to convert 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) => AzureBareMetalProvisioningStatesEnum.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/src/BareMetal/generated/api/Support/AzureBareMetalProvisioningStatesEnum.cs b/src/BareMetal/generated/api/Support/AzureBareMetalProvisioningStatesEnum.cs
new file mode 100644
index 000000000000..c725f139f82b
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/AzureBareMetalProvisioningStatesEnum.cs
@@ -0,0 +1,114 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// State of provisioning of the AzureBareMetalInstance
+ public partial struct AzureBareMetalProvisioningStatesEnum :
+ System.IEquatable
+ {
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Accepted = @"Accepted";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Creating = @"Creating";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Deleting = @"Deleting";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Failed = @"Failed";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Migrating = @"Migrating";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Succeeded = @"Succeeded";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum Updating = @"Updating";
+
+ ///
+ /// the value for an instance of the Enum.
+ ///
+ private string _value { get; set; }
+
+ ///
+ /// Creates an instance of the
+ ///
+ /// the value to create an instance for.
+ private AzureBareMetalProvisioningStatesEnum(string underlyingValue)
+ {
+ this._value = underlyingValue;
+ }
+
+ /// Conversion from arbitrary object to AzureBareMetalProvisioningStatesEnum
+ /// the value to convert to an instance of .
+ internal static object CreateFrom(object value)
+ {
+ return new AzureBareMetalProvisioningStatesEnum(global::System.Convert.ToString(value));
+ }
+
+ /// Compares values of enum type AzureBareMetalProvisioningStatesEnum
+ /// 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.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e)
+ {
+ return _value.Equals(e._value);
+ }
+
+ ///
+ /// Compares values of enum type AzureBareMetalProvisioningStatesEnum (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 AzureBareMetalProvisioningStatesEnum && Equals((AzureBareMetalProvisioningStatesEnum)obj);
+ }
+
+ /// Returns hashCode for enum AzureBareMetalProvisioningStatesEnum
+ /// The hashCode of the value
+ public override int GetHashCode()
+ {
+ return this._value.GetHashCode();
+ }
+
+ /// Returns string representation for AzureBareMetalProvisioningStatesEnum
+ /// A string for this value.
+ public override string ToString()
+ {
+ return this._value;
+ }
+
+ /// Implicit operator to convert string to AzureBareMetalProvisioningStatesEnum
+ /// the value to convert to an instance of .
+
+ public static implicit operator AzureBareMetalProvisioningStatesEnum(string value)
+ {
+ return new AzureBareMetalProvisioningStatesEnum(value);
+ }
+
+ /// Implicit operator to convert AzureBareMetalProvisioningStatesEnum to string
+ /// the value to convert to an instance of .
+
+ public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e)
+ {
+ return e._value;
+ }
+
+ /// Overriding != operator for enum AzureBareMetalProvisioningStatesEnum
+ /// 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.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e2)
+ {
+ return !e2.Equals(e1);
+ }
+
+ /// Overriding == operator for enum AzureBareMetalProvisioningStatesEnum
+ /// 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.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.AzureBareMetalProvisioningStatesEnum e2)
+ {
+ return e2.Equals(e1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/api/Support/CreatedByType.Completer.cs b/src/BareMetal/generated/api/Support/CreatedByType.Completer.cs
new file mode 100644
index 000000000000..b8365cd4d891
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/CreatedByType.Completer.cs
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// The type of identity that created the resource.
+ [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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/src/BareMetal/generated/api/Support/CreatedByType.TypeConverter.cs b/src/BareMetal/generated/api/Support/CreatedByType.TypeConverter.cs
new file mode 100644
index 000000000000..8482170c5ad9
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/CreatedByType.TypeConverter.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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/src/BareMetal/generated/api/Support/CreatedByType.cs b/src/BareMetal/generated/api/Support/CreatedByType.cs
new file mode 100644
index 000000000000..94e74608bf27
--- /dev/null
+++ b/src/BareMetal/generated/api/Support/CreatedByType.cs
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support
+{
+
+ /// The type of identity that created the resource.
+ public partial struct CreatedByType :
+ System.IEquatable
+ {
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType Application = @"Application";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType Key = @"Key";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType ManagedIdentity = @"ManagedIdentity";
+
+ public static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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
+ /// 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.BareMetal.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.BareMetal.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.BareMetal.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Support.CreatedByType e2)
+ {
+ return e2.Equals(e1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/cmdlets/GetAzBareMetalOperation_List.cs b/src/BareMetal/generated/cmdlets/GetAzBareMetalOperation_List.cs
new file mode 100644
index 000000000000..de08e6bad244
--- /dev/null
+++ b/src/BareMetal/generated/cmdlets/GetAzBareMetalOperation_List.cs
@@ -0,0 +1,352 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+ using System;
+
+ /// Gets a list of AzureBareMetal management operations.
+ ///
+ /// [OpenAPI] List=>GET:"/providers/Microsoft.BareMetalInfrastructure/operations"
+ ///
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.InternalExport]
+ [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBareMetalOperation_List")]
+ [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IOperation))]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Gets a list of AzureBareMetal management operations.")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated]
+ public partial class GetAzBareMetalOperation_List : global::System.Management.Automation.PSCmdlet,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener
+ {
+ /// A unique id generatd for the this cmdlet when it is instantiated.
+ private string __correlationId = System.Guid.NewGuid().ToString();
+
+ /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)
+ private global::System.Management.Automation.InvocationInfo __invocationInfo;
+
+ /// A unique id generatd for the this cmdlet when ProcessRecord() is called.
+ private string __processRecordId;
+
+ ///
+ /// The for this operation.
+ ///
+ private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource();
+
+ /// Wait for .NET debugger to attach
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter Break { get; set; }
+
+ /// The reference to the client API class.
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.ClientAPI;
+
+ ///
+ /// The credentials, account, tenant, and subscription used for communication with Azure
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Azure)]
+ public global::System.Management.Automation.PSObject DefaultProfile { get; set; }
+
+ /// SendAsync Pipeline Steps to be appended to the front of the pipeline
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel;
+
+ /// cancellation token.
+ global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener.Token => _cancellationTokenSource.Token;
+
+ ///
+ /// The instance of the that the remote call will use.
+ ///
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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 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 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()
+ {
+ Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials);
+ if (Break)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.AttachDebugger.Break();
+ }
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+
+ /// Performs clean-up after the command execution
+ protected override void EndProcessing()
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+
+ ///
+ /// Intializes a new instance of the cmdlet class.
+ ///
+ public GetAzBareMetalOperation_List()
+ {
+
+ }
+
+ /// Handles/Dispatches events during the call to the REST service.
+ /// The message id
+ /// The message cancellation token. When this call is cancelled, this should be true
+ /// Detailed message data for the message event.
+ ///
+ /// A that will be complete when handling of the message is completed.
+ ///
+ async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.Verbose:
+ {
+ WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Warning:
+ {
+ WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Information:
+ {
+ var data = messageData();
+ WriteInformation(data.Message, new string[]{});
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Debug:
+ {
+ WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Error:
+ {
+ WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) );
+ return ;
+ }
+ }
+ await Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ __processRecordId = System.Guid.NewGuid().ToString();
+ try
+ {
+ // work
+ using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token) )
+ {
+ asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName);
+ if (null != HttpPipelinePrepend)
+ {
+ Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend);
+ }
+ if (null != HttpPipelineAppend)
+ {
+ Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend);
+ }
+ // get the client instance
+ try
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ await this.Client.OperationsList(onOk, onDefault, this, Pipeline);
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+ catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.UndeclaredResponseException urexception)
+ {
+ WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { })
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
+ });
+ }
+ finally
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordAsyncEnd);
+ }
+ }
+ }
+
+ /// Interrupts currently running code within the command.
+ protected override void StopProcessing()
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Cancel();
+ base.StopProcessing();
+ }
+
+ ///
+ /// a delegate that is called when the remote service returns default (any response code not handled elsewhere).
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a 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.BareMetal.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 from the remote call
+ ///
+ /// A that will be complete when handling of the method is completed.
+ ///
+ private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response)
+ {
+ using( NoSynchronizationContext )
+ {
+ var _returnNow = global::System.Threading.Tasks.Task.FromResult(false);
+ overrideOnOk(responseMessage, response, ref _returnNow);
+ // if overrideOnOk has returned true, then return right away.
+ if ((null != _returnNow && await _returnNow))
+ {
+ return ;
+ }
+ // onOk - response for 200 / application/json
+ // response should be returning an array of some kind. +Pageable
+ // pageable / value /
+ WriteObject((await response).Value, true);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/cmdlets/GetAzBareMetal_Get.cs b/src/BareMetal/generated/cmdlets/GetAzBareMetal_Get.cs
new file mode 100644
index 000000000000..6c6f3b0d6c76
--- /dev/null
+++ b/src/BareMetal/generated/cmdlets/GetAzBareMetal_Get.cs
@@ -0,0 +1,402 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+ using System;
+
+ ///
+ /// Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
+ ///
+ ///
+ /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}"
+ ///
+ [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBareMetal_Get")]
+ [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance))]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated]
+ public partial class GetAzBareMetal_Get : global::System.Management.Automation.PSCmdlet,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener
+ {
+ /// A unique id generatd for the this cmdlet when it is instantiated.
+ private string __correlationId = System.Guid.NewGuid().ToString();
+
+ /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)
+ private global::System.Management.Automation.InvocationInfo __invocationInfo;
+
+ /// A unique id generatd for the this cmdlet when ProcessRecord() is called.
+ private string __processRecordId;
+
+ ///
+ /// The for this operation.
+ ///
+ private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource();
+
+ /// Wait for .NET debugger to attach
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter Break { get; set; }
+
+ /// The reference to the client API class.
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.ClientAPI;
+
+ ///
+ /// The credentials, account, tenant, and subscription used for communication with Azure
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Azure)]
+ public global::System.Management.Automation.PSObject DefaultProfile { get; set; }
+
+ /// SendAsync Pipeline Steps to be appended to the front of the pipeline
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel;
+
+ /// cancellation token.
+ global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener.Token => _cancellationTokenSource.Token;
+
+ /// Backing field for property.
+ private string _name;
+
+ /// Name of the Azure BareMetal on Azure instance.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the Azure BareMetal on Azure instance.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"Name of the Azure BareMetal on Azure instance.",
+ SerializedName = @"azureBareMetalInstanceName",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::System.Management.Automation.Alias("AzureBareMetalInstanceName")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Path)]
+ public string Name { get => this._name; set => this._name = value; }
+
+ ///
+ /// The instance of the that the remote call will use.
+ ///
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; }
+
+ /// Backing field for property.
+ private string _resourceGroupName;
+
+ /// The name of the resource group. The name is case insensitive.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The name of the resource group. The name is case insensitive.",
+ SerializedName = @"resourceGroupName",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Path)]
+ public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; }
+
+ /// Backing field for property.
+ private string[] _subscriptionId;
+
+ /// The ID of the target subscription.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The ID of the target subscription.",
+ SerializedName = @"subscriptionId",
+ PossibleTypes = new [] { typeof(string) })]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo(
+ Name = @"",
+ Description =@"",
+ Script = @"(Get-AzContext).Subscription.Id")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Path)]
+ public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; }
+
+ ///
+ /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what
+ /// happens on that response. Implement this method in a partial class to enable this behavior
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a 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 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()
+ {
+ Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials);
+ if (Break)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.AttachDebugger.Break();
+ }
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+
+ /// Performs clean-up after the command execution
+ protected override void EndProcessing()
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+
+ ///
+ /// Intializes a new instance of the cmdlet class.
+ ///
+ public GetAzBareMetal_Get()
+ {
+
+ }
+
+ /// Handles/Dispatches events during the call to the REST service.
+ /// The message id
+ /// The message cancellation token. When this call is cancelled, this should be true
+ /// Detailed message data for the message event.
+ ///
+ /// A that will be complete when handling of the message is completed.
+ ///
+ async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.Verbose:
+ {
+ WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Warning:
+ {
+ WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Information:
+ {
+ var data = messageData();
+ WriteInformation(data.Message, new string[]{});
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Debug:
+ {
+ WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Error:
+ {
+ WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) );
+ return ;
+ }
+ }
+ await Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ __processRecordId = System.Guid.NewGuid().ToString();
+ try
+ {
+ // work
+ using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token) )
+ {
+ asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName);
+ if (null != HttpPipelinePrepend)
+ {
+ Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend);
+ }
+ if (null != HttpPipelineAppend)
+ {
+ Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend);
+ }
+ // get the client instance
+ try
+ {
+ foreach( var SubscriptionId in this.SubscriptionId )
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ await this.Client.AzureBareMetalInstancesGet(SubscriptionId, ResourceGroupName, Name, onOk, onDefault, this, Pipeline);
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+ }
+ catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.UndeclaredResponseException urexception)
+ {
+ WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name})
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
+ });
+ }
+ finally
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordAsyncEnd);
+ }
+ }
+ }
+
+ /// Interrupts currently running code within the command.
+ protected override void StopProcessing()
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Cancel();
+ base.StopProcessing();
+ }
+
+ ///
+ /// a delegate that is called when the remote service returns default (any response code not handled elsewhere).
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a 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.BareMetal.Runtime.RestException(responseMessage, await response);
+ WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name })
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action }
+ });
+ }
+ else
+ {
+ WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name })
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty }
+ });
+ }
+ }
+ }
+
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a 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.BareMetal.Models.Api20210809.IAzureBareMetalInstance
+ WriteObject((await response));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/cmdlets/GetAzBareMetal_List.cs b/src/BareMetal/generated/cmdlets/GetAzBareMetal_List.cs
new file mode 100644
index 000000000000..b77c0b2f808a
--- /dev/null
+++ b/src/BareMetal/generated/cmdlets/GetAzBareMetal_List.cs
@@ -0,0 +1,396 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+ using System;
+
+ ///
+ /// Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each
+ /// Azure BareMetal instance.
+ ///
+ ///
+ /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances"
+ ///
+ [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBareMetal_List")]
+ [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance))]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance.")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated]
+ public partial class GetAzBareMetal_List : global::System.Management.Automation.PSCmdlet,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener
+ {
+ /// A unique id generatd for the this cmdlet when it is instantiated.
+ private string __correlationId = System.Guid.NewGuid().ToString();
+
+ /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)
+ private global::System.Management.Automation.InvocationInfo __invocationInfo;
+
+ /// A unique id generatd for the this cmdlet when ProcessRecord() is called.
+ private string __processRecordId;
+
+ ///
+ /// The for this operation.
+ ///
+ private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource();
+
+ /// A flag to tell whether it is the first onOK call.
+ private bool _isFirst = true;
+
+ /// Link to retrieve next page.
+ private string _nextLink;
+
+ /// Wait for .NET debugger to attach
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter Break { get; set; }
+
+ /// The reference to the client API class.
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.ClientAPI;
+
+ ///
+ /// The credentials, account, tenant, and subscription used for communication with Azure
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Azure)]
+ public global::System.Management.Automation.PSObject DefaultProfile { get; set; }
+
+ /// SendAsync Pipeline Steps to be appended to the front of the pipeline
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel;
+
+ /// cancellation token.
+ global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener.Token => _cancellationTokenSource.Token;
+
+ ///
+ /// The instance of the that the remote call will use.
+ ///
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; }
+
+ /// Backing field for property.
+ private string[] _subscriptionId;
+
+ /// The ID of the target subscription.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The ID of the target subscription.",
+ SerializedName = @"subscriptionId",
+ PossibleTypes = new [] { typeof(string) })]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo(
+ Name = @"",
+ Description =@"",
+ Script = @"(Get-AzContext).Subscription.Id")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Path)]
+ public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; }
+
+ ///
+ /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what
+ /// happens on that response. Implement this method in a partial class to enable this behavior
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a 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 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()
+ {
+ Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials);
+ if (Break)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.AttachDebugger.Break();
+ }
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+
+ /// Performs clean-up after the command execution
+ protected override void EndProcessing()
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+
+ ///
+ /// Intializes a new instance of the cmdlet class.
+ ///
+ public GetAzBareMetal_List()
+ {
+
+ }
+
+ /// Handles/Dispatches events during the call to the REST service.
+ /// The message id
+ /// The message cancellation token. When this call is cancelled, this should be true
+ /// Detailed message data for the message event.
+ ///
+ /// A that will be complete when handling of the message is completed.
+ ///
+ async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.Verbose:
+ {
+ WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Warning:
+ {
+ WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Information:
+ {
+ var data = messageData();
+ WriteInformation(data.Message, new string[]{});
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Debug:
+ {
+ WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Error:
+ {
+ WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) );
+ return ;
+ }
+ }
+ await Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ __processRecordId = System.Guid.NewGuid().ToString();
+ try
+ {
+ // work
+ using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token) )
+ {
+ asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName);
+ if (null != HttpPipelinePrepend)
+ {
+ Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend);
+ }
+ if (null != HttpPipelineAppend)
+ {
+ Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend);
+ }
+ // get the client instance
+ try
+ {
+ foreach( var SubscriptionId in this.SubscriptionId )
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ await this.Client.AzureBareMetalInstancesListBySubscription(SubscriptionId, onOk, onDefault, this, Pipeline);
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+ }
+ catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.UndeclaredResponseException urexception)
+ {
+ WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId})
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
+ });
+ }
+ finally
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordAsyncEnd);
+ }
+ }
+ }
+
+ /// Interrupts currently running code within the command.
+ protected override void StopProcessing()
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Cancel();
+ base.StopProcessing();
+ }
+
+ ///
+ /// a delegate that is called when the remote service returns default (any response code not handled elsewhere).
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a 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.BareMetal.Runtime.RestException(responseMessage, await response);
+ WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId })
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action }
+ });
+ }
+ else
+ {
+ WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId })
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty }
+ });
+ }
+ }
+ }
+
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a from the remote call
+ ///
+ /// A that will be complete when handling of the method is completed.
+ ///
+ private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response)
+ {
+ using( NoSynchronizationContext )
+ {
+ var _returnNow = global::System.Threading.Tasks.Task.FromResult(false);
+ overrideOnOk(responseMessage, response, ref _returnNow);
+ // if overrideOnOk has returned true, then return right away.
+ if ((null != _returnNow && await _returnNow))
+ {
+ return ;
+ }
+ // onOk - response for 200 / application/json
+ // response should be returning an array of some kind. +Pageable
+ // pageable / value / nextLink
+ var result = await response;
+ WriteObject(result.Value,true);
+ _nextLink = result.NextLink;
+ if (_isFirst)
+ {
+ _isFirst = false;
+ while (_nextLink != null)
+ {
+ if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage )
+ {
+ requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Method.Get );
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ await this.Client.AzureBareMetalInstancesListBySubscription_Call(requestMessage, onOk, onDefault, this, Pipeline);
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BareMetal/generated/cmdlets/GetAzBareMetal_List1.cs b/src/BareMetal/generated/cmdlets/GetAzBareMetal_List1.cs
new file mode 100644
index 000000000000..3c388ee72f9b
--- /dev/null
+++ b/src/BareMetal/generated/cmdlets/GetAzBareMetal_List1.cs
@@ -0,0 +1,410 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Cmdlets
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Extensions;
+ using System;
+
+ ///
+ /// Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various
+ /// properties of each Azure BareMetal instance.
+ ///
+ ///
+ /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances"
+ ///
+ [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzBareMetal_List1")]
+ [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Models.Api20210809.IAzureBareMetalInstance))]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Description(@"Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance.")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Generated]
+ public partial class GetAzBareMetal_List1 : global::System.Management.Automation.PSCmdlet,
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener
+ {
+ /// A unique id generatd for the this cmdlet when it is instantiated.
+ private string __correlationId = System.Guid.NewGuid().ToString();
+
+ /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)
+ private global::System.Management.Automation.InvocationInfo __invocationInfo;
+
+ /// A unique id generatd for the this cmdlet when ProcessRecord() is called.
+ private string __processRecordId;
+
+ ///
+ /// The for this operation.
+ ///
+ private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource();
+
+ /// A flag to tell whether it is the first onOK call.
+ private bool _isFirst = true;
+
+ /// Link to retrieve next page.
+ private string _nextLink;
+
+ /// Wait for .NET debugger to attach
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter Break { get; set; }
+
+ /// The reference to the client API class.
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.BareMetal Client => Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.ClientAPI;
+
+ ///
+ /// The credentials, account, tenant, and subscription used for communication with Azure
+ ///
+ [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Azure)]
+ public global::System.Management.Automation.PSObject DefaultProfile { get; set; }
+
+ /// SendAsync Pipeline Steps to be appended to the front of the pipeline
+ [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")]
+ [global::System.Management.Automation.ValidateNotNull]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel;
+
+ /// cancellation token.
+ global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener.Token => _cancellationTokenSource.Token;
+
+ ///
+ /// The instance of the that the remote call will use.
+ ///
+ private Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Runtime)]
+ public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; }
+
+ /// Backing field for property.
+ private string _resourceGroupName;
+
+ /// The name of the resource group. The name is case insensitive.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The name of the resource group. The name is case insensitive.",
+ SerializedName = @"resourceGroupName",
+ PossibleTypes = new [] { typeof(string) })]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Path)]
+ public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; }
+
+ /// Backing field for property.
+ private string[] _subscriptionId;
+
+ /// The ID of the target subscription.
+ [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Info(
+ Required = true,
+ ReadOnly = false,
+ Description = @"The ID of the target subscription.",
+ SerializedName = @"subscriptionId",
+ PossibleTypes = new [] { typeof(string) })]
+ [Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.DefaultInfo(
+ Name = @"",
+ Description =@"",
+ Script = @"(Get-AzContext).Subscription.Id")]
+ [global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Category(global::Microsoft.Azure.PowerShell.Cmdlets.BareMetal.ParameterCategory.Path)]
+ public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; }
+
+ ///
+ /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what
+ /// happens on that response. Implement this method in a partial class to enable this behavior
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a 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 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()
+ {
+ Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials);
+ if (Break)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.AttachDebugger.Break();
+ }
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+
+ /// Performs clean-up after the command execution
+ protected override void EndProcessing()
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+
+ ///
+ /// Intializes a new instance of the cmdlet class.
+ ///
+ public GetAzBareMetal_List1()
+ {
+
+ }
+
+ /// Handles/Dispatches events during the call to the REST service.
+ /// The message id
+ /// The message cancellation token. When this call is cancelled, this should be true
+ /// Detailed message data for the message event.
+ ///
+ /// A that will be complete when handling of the message is completed.
+ ///
+ async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.Events.Verbose:
+ {
+ WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Warning:
+ {
+ WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Information:
+ {
+ var data = messageData();
+ WriteInformation(data.Message, new string[]{});
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Debug:
+ {
+ WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}");
+ return ;
+ }
+ case Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.Error:
+ {
+ WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) );
+ return ;
+ }
+ }
+ await Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ __processRecordId = System.Guid.NewGuid().ToString();
+ try
+ {
+ // work
+ using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token) )
+ {
+ asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.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.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ Pipeline = Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName);
+ if (null != HttpPipelinePrepend)
+ {
+ Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend);
+ }
+ if (null != HttpPipelineAppend)
+ {
+ Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend);
+ }
+ // get the client instance
+ try
+ {
+ foreach( var SubscriptionId in this.SubscriptionId )
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ await this.Client.AzureBareMetalInstancesListByResourceGroup(SubscriptionId, ResourceGroupName, onOk, onDefault, this, Pipeline);
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
+ }
+ }
+ catch (Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.UndeclaredResponseException urexception)
+ {
+ WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName})
+ {
+ ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
+ });
+ }
+ finally
+ {
+ await ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.Events.CmdletProcessRecordAsyncEnd);
+ }
+ }
+ }
+
+ /// Interrupts currently running code within the command.
+ protected override void StopProcessing()
+ {
+ ((Microsoft.Azure.PowerShell.Cmdlets.BareMetal.Runtime.IEventListener)this).Cancel();
+ base.StopProcessing();
+ }
+
+ ///
+ /// a delegate that is called when the remote service returns default (any response code not handled elsewhere).
+ ///
+ /// the raw response message as an global::System.Net.Http.HttpResponseMessage.
+ /// the body result as a 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.BareMetal.Runtime.RestException